Repository navigation
Description
These two places have a (culture, locale, ...) signature:
runtime/src/native/libs/System.Native.Browser/native/globalization-locale.ts
Lines 7 to 8 in bcb511a
| // char16_t* SystemJS_GetLocaleInfo (const uint16_t* locale, int32_t localeLength, const uint16_t* culture, int32_t cultureLength, const uint16_t* result, int32_t resultMaxLength, int *resultLength); | |
| export function SystemJS_GetLocaleInfo(culture: number, cultureLength: number, locale: number, localeLength: number, dst: number, dstMaxLength: number, dstLength: Int32Ptr): VoidPtr { |
runtime/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Browser.cs
Line 50 in bcb511a
| nint exceptionPtr = Interop.JsGlobalization.GetLocaleInfo(pCultureName, cultureNameSpan.Length, pLocaleName, localeNameSpan.Length, buffer, LOCALE_INFO_BUFFER_LEN, out int resultLength); |
While everywhere else has a (locale, culture, ...) signature, i.e.:
| EXTERN_C uint16_t* SystemJS_GetLocaleInfo (const uint16_t* locale, int32_t localeLength, const uint16_t* culture, int32_t cultureLength, const uint16_t* result, int32_t resultMaxLength, int *resultLength); |
| public static unsafe partial nint GetLocaleInfo(char* locale, int localeLength, char* culture, int cultureLength, char* buffer, int bufferLength, out int resultLength); |
Because the caller and callee are both wrong in the same way, this does not appear to cause a behavior issue, but it makes it easy to call incorrectly since the intellisense info does not match the actual implementation. In some cases getting the order wrong will only cause subtle behavior issues, which makes it trickier to diagnose. Wanted to at least mention this since we hit a bug on our end caused by it.
Activity
dotnet-policy-service commentedon Oct 8, 2026
Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Oct 8, 2026
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.
makazeu commentedon Oct 13, 2026
The same argument-order mismatch also exists in the Mono browser implementation, so it should be updated alongside the System.Native.Browser implementation.
[browser] Make SystemJS_GetLocaleInfo argument order consistent (#135983