| 1 | // Licensed to the .NET Foundation under one or more agreements. |
| 2 | // The .NET Foundation licenses this file to you under the MIT license. |
| 3 | // See the LICENSE file in the project root for more information. |
| 4 | |
| 5 | /* |
| 6 | Function: |
| 7 | UErrorCodeToBool |
| 8 | |
| 9 | Convert an ICU UErrorCode to a Bool compatible with Win32 |
| 10 | Returns 1 for success, 0 otherwise |
| 11 | */ |
| 12 | int32_t UErrorCodeToBool(UErrorCode code); |
| 13 | |
| 14 | /* |
| 15 | Function: |
| 16 | GetLocale |
| 17 | |
| 18 | Converts a managed localeName into something ICU understands and can use as a localeName. |
| 19 | */ |
| 20 | int32_t GetLocale(const UChar* localeName, |
| 21 | char* localeNameResult, |
| 22 | int32_t localeNameResultLength, |
| 23 | bool canonicalize, |
| 24 | UErrorCode* err); |
| 25 | |
| 26 | /* |
| 27 | Function: |
| 28 | u_charsToUChars_safe |
| 29 | |
| 30 | Copies the given null terminated char* to UChar with error checking. Replacement for ICU u_charsToUChars |
| 31 | */ |
| 32 | UErrorCode u_charsToUChars_safe(const char* str, UChar* value, int32_t valueLength); |
| 33 | |
| 34 | /* |
| 35 | Function: |
| 36 | FixupLocaleName |
| 37 | |
| 38 | Replace underscores with hyphens to interop with existing .NET code. |
| 39 | Returns the length of the string. |
| 40 | */ |
| 41 | int FixupLocaleName(UChar* value, int32_t valueLength); |
| 42 | |
| 43 | /* |
| 44 | Function: |
| 45 | DetectDefaultLocaleName |
| 46 | |
| 47 | Detect the default locale for the machine, defaulting to Invaraint if |
| 48 | we can't compute one (different from uloc_getDefault()) would do. |
| 49 | */ |
| 50 | const char* DetectDefaultLocaleName(); |
| 51 | |