[JS/TS] Char.ToUpper and Char.ToUpperInvariant expand one-to-many Unicode mappings
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 57/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- fsharp, javascript, typescript
- Ambito
- compilers
Direzione di ricerca
Start by tracing how System.Char.ToUpper and System.Char.ToUpperInvariant compile for Fable’s JavaScript and TypeScript targets, then compare that behavior with the Rust target described in the issue. Reproduce the four examples in the issue and check that each returns the expected single-character result, including unchanged characters without a simple uppercase mapping.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
In Fable targeting JavaScript/TypeScript, System.Char.ToUpper and System.Char.ToUpperInvariant compile directly to c.toLocaleUpperCase() and c.toUpperCase(). Because Fable represents char as a 1-character string and int c as c.charCodeAt(0), characters whose full Unicode uppercase mapping has multiple UTF-16 code units produce a multi-character char value or truncate to the first code unit when converted to int.
In .NET (and in Fable's Rust target), Char.ToUpper and Char.ToUpperInvariant use simple single-character case mapping and return the input character unchanged when it has no single-character uppercase equivalent or is already titlecase/uppercase (such as U+1F88 'ᾈ').
Repro code
open System
printfn "%d" (int (Char.ToUpperInvariant 'ß'))
printfn "%d" (int (Char.ToUpper 'ʼn'))
printfn "%d" (int (Char.ToUpperInvariant 'ᾈ'))
printfn "%s" (string (Char.ToUpperInvariant 'ß'))
Expected and actual results
Expected output (matching .NET 10.0.403):
223
329
8072
ß
Actual output under Fable (JavaScript/TypeScript on Node.js):
83
700
7944
SS
Related information
- Fable version: 5.27.0
- Operating system: Linux / macOS (Node.js)
Credit: https://ucsbplse.github.io/
- Lingua principale
- F#
- Stelle
- 3.2k
- Fork
- 335
- Merge medio
- 18h 57m
- PR unite (30g)
- 154
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fable-compiler/Fable
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
fable-compiler/Fable#5280 ·
I maintainer di solito rispondono entro 1 giorno
-
agentic-workflows automation repo-assist
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
fable-compiler/Fable#4531 ·
I maintainer di solito rispondono entro 1 giorno
-
agentic-workflows automation repo-assist
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
fable-compiler/Fable#4522 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
fable-compiler/Fable#5281 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
fable-compiler/Fable#5272 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fable-compiler/Fable
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
compiler: `void` inside a constant array or object literal throws in `PureFunctionConstant.keyOf`Apertaarea: compiler
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
segfaultcafe/flecha#208 ·
I maintainer di solito rispondono entro 1 giorno
-
bug gc sev-3
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
S3: friction & debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
MedakaLang/medaka#4940 ·
I maintainer di solito rispondono entro 1 giorno