Skip to content

Incorrect argument order for SystemJS_GetLocaleInfo #135439

Closed

Description

@kg-unity3d

These two places have a (culture, locale, ...) signature:

// 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 {

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

  1. added
    untriaged
    on Oct 8, 2026
  2. dotnet-policy-service commented on Oct 8, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-globalization
    See info in area-owners.md if you want to be subscribed.

  3. added
    arch-wasm
    os-browser
    on Oct 8, 2026
  4. dotnet-policy-service commented on Oct 8, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
    See info in area-owners.md if you want to be subscribed.

  5. added this to the Future milestone on Oct 12, 2026
  6. removed
    untriaged
    on Oct 12, 2026
  7. makazeu commented on Oct 13, 2026

    @makazeu
    Contributor

    The same argument-order mismatch also exists in the Mono browser implementation, so it should be updated alongside the System.Native.Browser implementation.

  8. added a commit that references this issue on Oct 20, 2026
    9e26259
  9. locked and limited conversation to collaborators on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmarea-System.Globalizationos-browser

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions