# ADD zh_TW.UTF-8 support.#3666
Conversation
ADD zh_TW.UTF-8 support.
| @@ -1,8 +1,13 @@ | |||
| # Force UTF-8 to avoid encoding issues for users with broken locale settings. | |||
| if [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]] | |||
There was a problem hiding this comment.
What does locale charmap output for zh_TW.UTF-8?
There was a problem hiding this comment.
It shows UTF-8. However the warning will still be there, because LC_ALL was set to en_US.UTF-8. Here is the locale details.
=>locale
LANG=zh_TW.UTF-8
LANGUAGE=zh_TW:zh
LC_CTYPE="zh_TW.UTF-8"
LC_NUMERIC="zh_TW.UTF-8"
LC_TIME="zh_TW.UTF-8"
LC_COLLATE="zh_TW.UTF-8"
LC_MONETARY="zh_TW.UTF-8"
LC_MESSAGES="zh_TW.UTF-8"
LC_PAPER="zh_TW.UTF-8"
LC_NAME="zh_TW.UTF-8"
LC_ADDRESS="zh_TW.UTF-8"
LC_TELEPHONE="zh_TW.UTF-8"
LC_MEASUREMENT="zh_TW.UTF-8"
LC_IDENTIFICATION="zh_TW.UTF-8"
LC_ALL=zh_TW.UTF-8
There was a problem hiding this comment.
Was your locale set to zh_TW.UTF-8 before running the brew bash script? If it was zh_TW.UTF-8 originally, then the export LC_ALL="en_US.UTF-8" shouldn't have happened in the first place.
There was a problem hiding this comment.
As @apjanke said: if locale charmap outputs UTF-8 it'll never set LC_ALL.
|
Are you getting this warning on macOS or Linux? I suspect this doesn't happen on macOS because the On my Sierra machine: Does your machine have the |
|
You are right, I am using Debian and testing it both in English version and Chinese version. There is no en_US.UTF-8 installed by default for Chinese version. This modified script works for both English installation and Chinese installation. The later comes with server input method for typing in Chinese so I believe most Chinese reader would choose this option in installation, which means, their system will not have en_US.UTF-8 installed. |
Closing as this isn't a macOS bug. Discuss this in Linuxbrew/brew#568. |
Before Change :
After Change :
[v ] Have you followed the guidelines in our Contributing document?
[v ] Have you checked to ensure there aren't other open Pull Requests for the same change?
[v ] Have you added an explanation of what your changes do and why you'd like us to include them?
To add zh_TW.UTF-8 support and remove annoying warning from bash
[x ] Have you written new tests for your changes? Here's an example.
[v ] Have you successfully run
brew testswith your changes locally?Yes, warning message removed in both en_US.UTF-8 and zh_TW.UTF-8