8000 Variables saved with C locale are broken in other locales (was "iTerm2: Wrong $PWD after locale is changed") · Issue #2613 · fish-shell/fish-shell · GitHub
[go: up one dir, main page]

Skip to content

Variables saved with C locale are broken in other locales (was "iTerm2: Wrong $PWD after locale is changed") #2613

@ghost

Description

Already discussed in another issue: https://gitlab.com/gnachman/iterm2/issues/4083
But it seems more like a problem from fish.

Steps to reproduce:

  1. iTerm2 Preferences > Profiles > General > Working Directory: Reuse previous session's directory
  2. In config.fish, export LANG="en_US.UTF-8"
  3. cd /path/to/Äpfel; and echo $PWD outputs /path/to/Äpfel
  4. Switch to a new tab by pressing command-T
  5. In the new tab, echo $PWD, gets /path/to/A�pfel
  6. pwd outputs: /path/to/Äpfel (normal)

I suspect this is related to Unicode Normalization Form Decomposition (NFD). And here are some JavaScript for comparison:

$ encodeURI('Äpfel'.normalize('NFD'))
"A%CC%88pfel"
$ decodeURI(encodeURI('Äpfel'.normalize('NFD')))
"Äpfel"
$ unescape(encodeURI('Äpfel'.normalize('NFD')))
"A�pfel"

and two fish commands to illustrate the mechanism of unescape above:

$ printf '\xcc\x88'
 ̈
$ printf '\u00cc\u0088'
�

Metadata

Metadata

Assignees

Labels

bugSomething that's not working as intended

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0