Skip to content

"hello".toLocaleUpperCase() and Intl.getCanonicalLocales(['und']) issues #14741

Description

Problem Description

"hello from 0.78".toLocaleUpperCase() returns "uppered" string not "HELLO FROM 0.78" what i was expecting and is returned in RNW 0.77.

Intl.getCanonicalLocales(['und']) fails to RangeError: Invalid language tag: und.

Same issues now also on RNW 0.79.

Steps To Reproduce

Create HelloWorld 0.78 or 0.79

npx @react-native-community/cli init hello078 --version "0.78.2"
cd hello078
yarn add react-native-windows@0.78.6
npx react-native init-windows --overwrite --template old/uwp-cs-app

add logs into app

const localeHello = 'hello world 0.78'.toLocaleUpperCase();
const hello = 'hello world 0.78'.toUpperCase();
console.log({hello, localeHello});

and log is

LOG {"hello": "HELLO WORLD 0.78", "localeHello": "uppered"}

Expected Results

LOG {"hello": "HELLO WORLD 0.78", "localeHello": "HELLO WORLD 0.78"}

CLI version

15.0.1

Environment

info Fetching system and libraries information...
System:
  OS: Windows 10 10.0.19045
  CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
  Memory: 17.64 GB / 31.90 GB
Binaries:
  Node:
    version: 20.18.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 10.8.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
      - 10.0.26100.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.14.36202.13 (Visual Studio Community 2022)
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.1
    path: C:\Ruby26-x64\bin\ruby.EXE
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.78.2
    wanted: 0.78.2
  react-native-windows:
    installed: 0.78.6
    wanted: 0.78.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

No response

Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions