Symptom
With ls or cat, file names and content containing non-ASCII characters (accented letters, non-Latin scripts) show as question marks, boxes or garbage. In git status, such paths turn into backslashes and digits like \346\226\207. Or the characters display correctly, but the cursor lands in the wrong place when you type and delete.
Possible causes (most common first)
- The locale environment variables LANG and LC_ALL are unset or set to C. Shells started through remote login, scheduled jobs or certain tools often come without them.
- By default git treats bytes above 0x80 in paths as “unusual” characters and displays them escaped as octal. This is not corruption; the file itself is fine.
- The text encoding of the Terminal profile was changed to something other than UTF-8.
- The file itself is not UTF-8 encoded, for example an old text file brought over from Windows.
Troubleshooting steps (easiest first)
Check the locale first
Run
localein Terminal. If LANG and LC_CTYPE in the output are empty orC, this is the cause. Add the lineexport LANG=en_US.UTF-8to~/.zshrc(to get command-line messages in another language, use that language's locale name with the same.UTF-8ending), then open a new terminal and try again. The part that matters is the UTF-8 at the end; the first half only decides the language of messages.git paths turned into numbers: change one setting
Run
git config --global core.quotePath false. According to the description of core.quotePath in the official git documentation, with it set to false, bytes above 0x80 are no longer treated as unusual characters and non-ASCII paths are shown as they are.Check the terminal's text encoding
In the Terminal app, open Settings → Profiles, select the profile in use, and on the Advanced tab, in the International section, confirm that the text encoding is Unicode (UTF-8) and that “Set locale environment variables on startup” is ticked. See Apple's Terminal User Guide. These settings apply only to the selected profile. With another terminal such as iTerm2, look for the matching options in its own settings.
Handle tmux and remote login separately
If text is garbled only inside tmux, make sure the locale variables are set before tmux starts, then exit all old sessions and restart the tmux server. If it is garbled in a shell entered through remote login, that side most likely did not read your configuration file; put the export line in
~/.zprofile, which login shells read as well.Only one file is garbled: it is the file's encoding
If other non-ASCII text displays correctly and only one file's content is garbled, the problem is the file. Use
filefollowed by the file name to see its encoding, then convert it withiconv -f WINDOWS-1252 -t UTF-8 old.txt > new.txt, replacing WINDOWS-1252 with the actual source encoding.
When to contact support directly
This is a configuration issue in your own user environment. It normally does not need support and has nothing to do with a machine fault. The exceptions: non-Latin text shows as boxes in every app on the remote desktop (a font may be missing or the system language resources may be faulty), or non-Latin text pasted into the remote desktop turns into garbage (a clipboard issue in the remote-access app). In those cases contact support on Contact support with your machine ID, the remote connection method you use, the output of locale and a screenshot.
Related
- Remote Mac mini for heavy Claude Code use: an always-on workstation, not account insurance
- Coding on a remote Mac mini: remote desktop or terminal?
- Remote Mac shows a different time from mine, or the wrong interface language: how to change it
- git push fails with Authentication failed or Permission denied (publickey) on a remote Mac
- What to do on day one with a rented remote Mac mini
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support