From 21c6cd396fe27c376f227c8cad792a59742a549d Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Tue, 3 Dec 2024 14:58:36 -0800 Subject: [PATCH 1/8] Add Globalization Loading Doc Section --- docs/core/extensions/globalization-icu.md | 46 ++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/docs/core/extensions/globalization-icu.md b/docs/core/extensions/globalization-icu.md index a3b66179eb925..02256dfd6ff16 100644 --- a/docs/core/extensions/globalization-icu.md +++ b/docs/core/extensions/globalization-icu.md @@ -253,7 +253,25 @@ For framework-dependent apps (not self-contained) where ICU is consumed from a l This must be done for all the ICU binaries for the supported runtimes. Also, the `NuGetPackageId` metadata in the `RuntimeTargetsCopyLocalItems` item group needs to match a NuGet package that the project actually references. -### macOS behavior +## Loading Specific ICU Version on Linux + +By default, when using ICU on Linux, .NET attempts to load the latest installed version of ICU from the system. However, you can specify a specific version of ICU to load by setting the `DOTNET_ICU_VERSION_OVERRIDE` environment variable. Here's how it works: + +- **Using the Build-Time ICU Version** + Setting the environment variable to `build` instructs .NET to use the exact ICU version that was utilized during its build process. This version is typically defined in the ICU C header file `unicode/uvernum.h`, generated during ICU's build process. The version is determined by the constant [U_ICU_VERSION_MAJOR_NUM](https://github.com/microsoft/icu/blob/bfb7d6bd5b03d2f5322389d21efee8fd1a167269/icu/icu4c/source/common/unicode/uvernum.h#L56) in the header file. + +- **Specifying a Custom ICU Version** + If the environment variable is set to a specific version number, such as `67.1`, .NET will attempt to load that version of ICU. For example, it will look for the libraries `libicuuc.so.67.1` and `libicui18n.so.67.1`. + +- **Fallback Mechanism** + If the specified version is not found, .NET will fall back to loading the highest installed ICU version from the system. + +This configuration provides flexibility in controlling ICU version usage, ensuring compatibility with application-specific or system-provided ICU versions. + +> [!NOTE] +> For .NET versions earlier than .NET 10, the environment variable is called `CLR_ICU_VERSION_OVERRIDE`. + +## macOS behavior macOS has a different behavior for resolving dependent dynamic libraries from the load commands specified in the `Mach-O` file than the Linux loader. In the Linux loader, .NET can try `libicudata`, `libicuuc`, and `libicui18n` (in that order) to satisfy ICU dependency graph. However, on macOS, this doesn't work. When building ICU on macOS, you, by default, get a dynamic library with these load commands in `libicuuc`. The following snippet shows an example. @@ -305,3 +323,29 @@ The following APIs are supported with limitations: - returns the same value as . In addition, fewer locales are supported. The supported list can be found in the [dotnet/icu repo](https://github.com/dotnet/icu/blob/dotnet/main/icu-filters/icudt_wasm.json#L7-L195). + +## Globalization Setup in .NET Applications + +.NET globalization initialization is a complex process that involves loading the appropriate globalization library, setting up the culture data, and configuring the globalization settings. The following sections describe how globalization initialization works on different platforms. + +### Windows + +On Windows, .NET follow the following steps to initialize globalization: +- Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library and avoids using NLS APIs. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. +- Check whether [NLS mode](#use-nls-instead-of-icu) is enabled. If enabled, .NET will skip loading the ICU library and instead rely on Windows [NLS](https://learn.microsoft.com/en-us/windows/win32/intl/national-language-support) APIs for globalization support. +- Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 72.1, .NET will first try to load `icuuc72.dll`, `icuin72.dll`, and `icudt72.dll`. If these libraries cannot be loaded, it will then attempt to load `icuuc72.1.dll`, `icuin72.1.dll`, and `icudt72.1.dll`. If none of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. +- If none of the preceding conditions are satisfied, .NET will attempt to load the ICU library from the system directory. It first tries to load `icu.dll`. If this library is unavailable, it will then attempt to load `icuuc.dll` and `icuin.dll`from the system directory. If any of these libraries are not found, the runtime will fall back to using NLS APIs for globalization support. + +> [!NOTE] +> NLS APIs are always available in all Windows versions, so .NET can always rely falling back on them for globalization support. + +### Linux +- Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. +- Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 68.2.0.9, .NET will try to load `libicuuc.so.68.2.0.9` and `libicui18n.so.68.2.0.9`. If any of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. +- Check if the `DOTNET_ICU_VERSION_OVERRIDE` environment variable is set. If it is, .NET will attempt to load the specified version of ICU as desctibed in [Loading Specific ICU Version on Linux](#loading-specific-icu-version-on-linux). +- If none of the preceding conditions are satisfied, .NET will attempt to load the highest installed version of the ICU library from the system. It try to load the libraries `libicuuc.so.[version]` and `libicui18n.so.[version]` where `[version]` is the highest installed version of ICU on the system. If the libraries are not found, the process will terminate with an error message such as: `Failed to load system ICU: {library name}`. + +### macOS +- Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. +- Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 68.2.0.9, .NET will try to load `libicuuc68.2.0.9.dylib` and `libicui18n68.2.0.9.dylib`. If any of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. +- If none of the preceding conditions are satisfied, .NET will attempt to load the installed version of the ICU library as described in [macOS behavior](#macos-behavior). From f09c2c4e6382e72446a04dc14e43aeb75f93e60e Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Tue, 3 Dec 2024 15:06:46 -0800 Subject: [PATCH 2/8] Fix formatting --- docs/core/extensions/globalization-icu.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/core/extensions/globalization-icu.md b/docs/core/extensions/globalization-icu.md index 02256dfd6ff16..bc655bb63d6e9 100644 --- a/docs/core/extensions/globalization-icu.md +++ b/docs/core/extensions/globalization-icu.md @@ -332,20 +332,25 @@ In addition, fewer locales are supported. The supported list can be found in the On Windows, .NET follow the following steps to initialize globalization: - Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library and avoids using NLS APIs. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. + - Check whether [NLS mode](#use-nls-instead-of-icu) is enabled. If enabled, .NET will skip loading the ICU library and instead rely on Windows [NLS](https://learn.microsoft.com/en-us/windows/win32/intl/national-language-support) APIs for globalization support. + - Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 72.1, .NET will first try to load `icuuc72.dll`, `icuin72.dll`, and `icudt72.dll`. If these libraries cannot be loaded, it will then attempt to load `icuuc72.1.dll`, `icuin72.1.dll`, and `icudt72.1.dll`. If none of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. + - If none of the preceding conditions are satisfied, .NET will attempt to load the ICU library from the system directory. It first tries to load `icu.dll`. If this library is unavailable, it will then attempt to load `icuuc.dll` and `icuin.dll`from the system directory. If any of these libraries are not found, the runtime will fall back to using NLS APIs for globalization support. > [!NOTE] > NLS APIs are always available in all Windows versions, so .NET can always rely falling back on them for globalization support. ### Linux + - Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. - Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 68.2.0.9, .NET will try to load `libicuuc.so.68.2.0.9` and `libicui18n.so.68.2.0.9`. If any of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. - Check if the `DOTNET_ICU_VERSION_OVERRIDE` environment variable is set. If it is, .NET will attempt to load the specified version of ICU as desctibed in [Loading Specific ICU Version on Linux](#loading-specific-icu-version-on-linux). - If none of the preceding conditions are satisfied, .NET will attempt to load the highest installed version of the ICU library from the system. It try to load the libraries `libicuuc.so.[version]` and `libicui18n.so.[version]` where `[version]` is the highest installed version of ICU on the system. If the libraries are not found, the process will terminate with an error message such as: `Failed to load system ICU: {library name}`. ### macOS + - Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. - Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 68.2.0.9, .NET will try to load `libicuuc68.2.0.9.dylib` and `libicui18n68.2.0.9.dylib`. If any of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. - If none of the preceding conditions are satisfied, .NET will attempt to load the installed version of the ICU library as described in [macOS behavior](#macos-behavior). From 70644ec3cf5b42d2623e45f3863d94f0bfe8c7c8 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Tue, 3 Dec 2024 15:24:27 -0800 Subject: [PATCH 3/8] remove en-US from the doc link --- docs/core/extensions/globalization-icu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/extensions/globalization-icu.md b/docs/core/extensions/globalization-icu.md index bc655bb63d6e9..ff99fd57a8653 100644 --- a/docs/core/extensions/globalization-icu.md +++ b/docs/core/extensions/globalization-icu.md @@ -333,7 +333,7 @@ In addition, fewer locales are supported. The supported list can be found in the On Windows, .NET follow the following steps to initialize globalization: - Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library and avoids using NLS APIs. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. -- Check whether [NLS mode](#use-nls-instead-of-icu) is enabled. If enabled, .NET will skip loading the ICU library and instead rely on Windows [NLS](https://learn.microsoft.com/en-us/windows/win32/intl/national-language-support) APIs for globalization support. +- Check whether [NLS mode](#use-nls-instead-of-icu) is enabled. If enabled, .NET will skip loading the ICU library and instead rely on Windows [NLS](https://learn.microsoft.com/windows/win32/intl/national-language-support) APIs for globalization support. - Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 72.1, .NET will first try to load `icuuc72.dll`, `icuin72.dll`, and `icudt72.dll`. If these libraries cannot be loaded, it will then attempt to load `icuuc72.1.dll`, `icuin72.1.dll`, and `icudt72.1.dll`. If none of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. From 133e4c671f51bb1b236706a9e91be1f25c3f8591 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed <10833894+tarekgh@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:30:33 -0800 Subject: [PATCH 4/8] Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- docs/core/extensions/globalization-icu.md | 32 +++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/core/extensions/globalization-icu.md b/docs/core/extensions/globalization-icu.md index bc655bb63d6e9..a6a5123176149 100644 --- a/docs/core/extensions/globalization-icu.md +++ b/docs/core/extensions/globalization-icu.md @@ -253,18 +253,21 @@ For framework-dependent apps (not self-contained) where ICU is consumed from a l This must be done for all the ICU binaries for the supported runtimes. Also, the `NuGetPackageId` metadata in the `RuntimeTargetsCopyLocalItems` item group needs to match a NuGet package that the project actually references. -## Loading Specific ICU Version on Linux +## Load specific ICU version on Linux By default, when using ICU on Linux, .NET attempts to load the latest installed version of ICU from the system. However, you can specify a specific version of ICU to load by setting the `DOTNET_ICU_VERSION_OVERRIDE` environment variable. Here's how it works: -- **Using the Build-Time ICU Version** - Setting the environment variable to `build` instructs .NET to use the exact ICU version that was utilized during its build process. This version is typically defined in the ICU C header file `unicode/uvernum.h`, generated during ICU's build process. The version is determined by the constant [U_ICU_VERSION_MAJOR_NUM](https://github.com/microsoft/icu/blob/bfb7d6bd5b03d2f5322389d21efee8fd1a167269/icu/icu4c/source/common/unicode/uvernum.h#L56) in the header file. +- **Use the build-time ICU version** -- **Specifying a Custom ICU Version** - If the environment variable is set to a specific version number, such as `67.1`, .NET will attempt to load that version of ICU. For example, it will look for the libraries `libicuuc.so.67.1` and `libicui18n.so.67.1`. + When you set the environment variable to `build`, .NET uses the exact ICU version that was used during its build process. This version is typically defined in the ICU C header file `unicode/uvernum.h`, generated during ICU's build process. The version is determined by the constant [U_ICU_VERSION_MAJOR_NUM](https://github.com/microsoft/icu/blob/bfb7d6bd5b03d2f5322389d21efee8fd1a167269/icu/icu4c/source/common/unicode/uvernum.h#L56) in the header file. -- **Fallback Mechanism** - If the specified version is not found, .NET will fall back to loading the highest installed ICU version from the system. +- **Specify a custom ICU version** + + If the environment variable is set to a specific version number, such as `67.1`, .NET attempts to load that version of ICU. For example, .NET looks for the libraries `libicuuc.so.67.1` and `libicui18n.so.67.1`. + +- **Fallback mechanism** + + If the specified version isn't found, .NET falls back to loading the highest installed ICU version from the system. This configuration provides flexibility in controlling ICU version usage, ensuring compatibility with application-specific or system-provided ICU versions. @@ -324,33 +327,34 @@ The following APIs are supported with limitations: In addition, fewer locales are supported. The supported list can be found in the [dotnet/icu repo](https://github.com/dotnet/icu/blob/dotnet/main/icu-filters/icudt_wasm.json#L7-L195). -## Globalization Setup in .NET Applications +## Globalization setup in .NET apps .NET globalization initialization is a complex process that involves loading the appropriate globalization library, setting up the culture data, and configuring the globalization settings. The following sections describe how globalization initialization works on different platforms. ### Windows On Windows, .NET follow the following steps to initialize globalization: + - Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library and avoids using NLS APIs. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. - Check whether [NLS mode](#use-nls-instead-of-icu) is enabled. If enabled, .NET will skip loading the ICU library and instead rely on Windows [NLS](https://learn.microsoft.com/en-us/windows/win32/intl/national-language-support) APIs for globalization support. - Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 72.1, .NET will first try to load `icuuc72.dll`, `icuin72.dll`, and `icudt72.dll`. If these libraries cannot be loaded, it will then attempt to load `icuuc72.1.dll`, `icuin72.1.dll`, and `icudt72.1.dll`. If none of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. -- If none of the preceding conditions are satisfied, .NET will attempt to load the ICU library from the system directory. It first tries to load `icu.dll`. If this library is unavailable, it will then attempt to load `icuuc.dll` and `icuin.dll`from the system directory. If any of these libraries are not found, the runtime will fall back to using NLS APIs for globalization support. +- If none of the preceding conditions are satisfied, .NET attempts to load the ICU library from the system directory. It first tries to load `icu.dll`. If this library is unavailable, it then attempts to load `icuuc.dll` and `icuin.dll` from the system directory. If any of these libraries aren't found, the runtime falls back to using NLS APIs for globalization support. > [!NOTE] -> NLS APIs are always available in all Windows versions, so .NET can always rely falling back on them for globalization support. +> NLS APIs are always available in all Windows versions, so .NET can always fall back on them for globalization support. ### Linux - Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. -- Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 68.2.0.9, .NET will try to load `libicuuc.so.68.2.0.9` and `libicui18n.so.68.2.0.9`. If any of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. -- Check if the `DOTNET_ICU_VERSION_OVERRIDE` environment variable is set. If it is, .NET will attempt to load the specified version of ICU as desctibed in [Loading Specific ICU Version on Linux](#loading-specific-icu-version-on-linux). -- If none of the preceding conditions are satisfied, .NET will attempt to load the highest installed version of the ICU library from the system. It try to load the libraries `libicuuc.so.[version]` and `libicui18n.so.[version]` where `[version]` is the highest installed version of ICU on the system. If the libraries are not found, the process will terminate with an error message such as: `Failed to load system ICU: {library name}`. +- Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 68.2.0.9, .NET will try to load `libicuuc.so.68.2.0.9` and `libicui18n.so.68.2.0.9`. If none of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. +- Check if the `DOTNET_ICU_VERSION_OVERRIDE` environment variable is set. If it is, .NET will attempt to load the specified version of ICU as described in [Load specific ICU version on Linux](#load-specific-icu-version-on-linux). +- If none of the preceding conditions are satisfied, .NET attempts to load the highest installed version of the ICU library from the system. It tries to load the libraries `libicuuc.so.[version]` and `libicui18n.so.[version]`, where `[version]` is the highest installed version of ICU on the system. If the libraries aren't found, the process terminates with an error message such as: `Failed to load system ICU: {library name}`. ### macOS - Check whether [Globalization Invariant Mode](https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md) is enabled. When this mode is active, .NET bypasses loading the ICU library. Instead, it relies on built-in invariant culture data, ensuring that behavior remains fully independent of the operating system and the ICU library. -- Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 68.2.0.9, .NET will try to load `libicuuc68.2.0.9.dylib` and `libicui18n68.2.0.9.dylib`. If any of the libraries are found, the process will terminate with an error message such as: `Failed to load app-local ICU: {library name}`. +- Check whether the [app-local ICU](#app-local-icu) feature is enabled. If it is, .NET will attempt to load the ICU library from the application directory by appending the specified version to the library names. For instance, if the version is 68.2.0.9, .NET will try to load `libicuuc68.2.0.9.dylib` and `libicui18n68.2.0.9.dylib`. If none of the libraries are found, the process terminates with an error message such as: `Failed to load app-local ICU: {library name}`. - If none of the preceding conditions are satisfied, .NET will attempt to load the installed version of the ICU library as described in [macOS behavior](#macos-behavior). From 44227a92bd5b1e56bb28a9b93b3b17146f36d005 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Tue, 3 Dec 2024 15:58:29 -0800 Subject: [PATCH 5/8] address the feedback --- docs/core/extensions/globalization-icu.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/core/extensions/globalization-icu.md b/docs/core/extensions/globalization-icu.md index e13bb007759ad..ab1cbc95e9d5b 100644 --- a/docs/core/extensions/globalization-icu.md +++ b/docs/core/extensions/globalization-icu.md @@ -257,14 +257,13 @@ This must be done for all the ICU binaries for the supported runtimes. Also, the By default, when using ICU on Linux, .NET attempts to load the latest installed version of ICU from the system. However, you can specify a specific version of ICU to load by setting the `DOTNET_ICU_VERSION_OVERRIDE` environment variable. Here's how it works: -- **Use the build-time ICU version** - - When you set the environment variable to `build`, .NET uses the exact ICU version that was used during its build process. This version is typically defined in the ICU C header file `unicode/uvernum.h`, generated during ICU's build process. The version is determined by the constant [U_ICU_VERSION_MAJOR_NUM](https://github.com/microsoft/icu/blob/bfb7d6bd5b03d2f5322389d21efee8fd1a167269/icu/icu4c/source/common/unicode/uvernum.h#L56) in the header file. - - **Specify a custom ICU version** If the environment variable is set to a specific version number, such as `67.1`, .NET attempts to load that version of ICU. For example, .NET looks for the libraries `libicuuc.so.67.1` and `libicui18n.so.67.1`. +> [!NOTE] +> This environment variable is only supported on .NET portable builds that are not obtained from Linux distribution package feeds. + - **Fallback mechanism** If the specified version isn't found, .NET falls back to loading the highest installed ICU version from the system. From aff38a79dd5bcab8718966b0a4ff170a1d3c498f Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Tue, 3 Dec 2024 16:11:37 -0800 Subject: [PATCH 6/8] minor update --- docs/core/extensions/globalization-icu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/extensions/globalization-icu.md b/docs/core/extensions/globalization-icu.md index ab1cbc95e9d5b..cfd5edbc852fa 100644 --- a/docs/core/extensions/globalization-icu.md +++ b/docs/core/extensions/globalization-icu.md @@ -262,7 +262,7 @@ By default, when using ICU on Linux, .NET attempts to load the latest installed If the environment variable is set to a specific version number, such as `67.1`, .NET attempts to load that version of ICU. For example, .NET looks for the libraries `libicuuc.so.67.1` and `libicui18n.so.67.1`. > [!NOTE] -> This environment variable is only supported on .NET portable builds that are not obtained from Linux distribution package feeds. +> This environment variable is supported only on .NET builds provided by Microsoft and is not supported on builds supplied by Linux distributions. - **Fallback mechanism** From 4bfd2992c62b0d0e13ded8c0613bc095fabf10d9 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed <10833894+tarekgh@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:15:35 -0800 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: Jan Kotas --- docs/core/extensions/globalization-icu.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/core/extensions/globalization-icu.md b/docs/core/extensions/globalization-icu.md index cfd5edbc852fa..4ddfa2e7c3fa2 100644 --- a/docs/core/extensions/globalization-icu.md +++ b/docs/core/extensions/globalization-icu.md @@ -255,14 +255,13 @@ This must be done for all the ICU binaries for the supported runtimes. Also, the ## Load specific ICU version on Linux -By default, when using ICU on Linux, .NET attempts to load the latest installed version of ICU from the system. However, you can specify a specific version of ICU to load by setting the `DOTNET_ICU_VERSION_OVERRIDE` environment variable. Here's how it works: +By default, when using ICU on Linux, .NET attempts to load the latest installed version of ICU from the system. However, you can specify a specific version of ICU to load by setting the `DOTNET_ICU_VERSION_OVERRIDE` environment variable. -- **Specify a custom ICU version** - - If the environment variable is set to a specific version number, such as `67.1`, .NET attempts to load that version of ICU. For example, .NET looks for the libraries `libicuuc.so.67.1` and `libicui18n.so.67.1`. +For example, if the environment variable is set to a specific version number, such as `67.1`, .NET attempts to load that version of ICU. For example, .NET looks for the libraries `libicuuc.so.67.1` and `libicui18n.so.67.1`. > [!NOTE] > This environment variable is supported only on .NET builds provided by Microsoft and is not supported on builds supplied by Linux distributions. +> For .NET versions earlier than .NET 10, the environment variable is called `CLR_ICU_VERSION_OVERRIDE`. - **Fallback mechanism** @@ -270,9 +269,6 @@ By default, when using ICU on Linux, .NET attempts to load the latest installed This configuration provides flexibility in controlling ICU version usage, ensuring compatibility with application-specific or system-provided ICU versions. -> [!NOTE] -> For .NET versions earlier than .NET 10, the environment variable is called `CLR_ICU_VERSION_OVERRIDE`. - ## macOS behavior macOS has a different behavior for resolving dependent dynamic libraries from the load commands specified in the `Mach-O` file than the Linux loader. In the Linux loader, .NET can try `libicudata`, `libicuuc`, and `libicui18n` (in that order) to satisfy ICU dependency graph. However, on macOS, this doesn't work. When building ICU on macOS, you, by default, get a dynamic library with these load commands in `libicuuc`. The following snippet shows an example. From 9b0302398b41a8636aa4a0cde9194f938c3c115d Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Wed, 4 Dec 2024 11:49:19 -0800 Subject: [PATCH 8/8] Update docs/core/extensions/globalization-icu.md --- docs/core/extensions/globalization-icu.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/core/extensions/globalization-icu.md b/docs/core/extensions/globalization-icu.md index 4ddfa2e7c3fa2..4e091c5f20ee3 100644 --- a/docs/core/extensions/globalization-icu.md +++ b/docs/core/extensions/globalization-icu.md @@ -263,9 +263,7 @@ For example, if the environment variable is set to a specific version number, su > This environment variable is supported only on .NET builds provided by Microsoft and is not supported on builds supplied by Linux distributions. > For .NET versions earlier than .NET 10, the environment variable is called `CLR_ICU_VERSION_OVERRIDE`. -- **Fallback mechanism** - - If the specified version isn't found, .NET falls back to loading the highest installed ICU version from the system. +If the specified version isn't found, .NET falls back to loading the highest installed ICU version from the system. This configuration provides flexibility in controlling ICU version usage, ensuring compatibility with application-specific or system-provided ICU versions.