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