| 1 |
Although locale -a says on FreeBSD 10.1 that zh_CN.GB18030 is supported, |
| 2 |
the conversion of CJK characters fails. |
| 3 |
This makes the gb18030 test of dos2unix fail on FreeBSD. |
| 4 |
|
| 5 |
|
| 6 |
The problem is wcstombs(), and this is demonstrated with wcstombs_test.c. |
| 7 |
|
| 8 |
Run the test with the command: gmake wcstombs |
| 9 |
|
| 10 |
This is correct output: |
| 11 |
|
| 12 |
cc -Wall -Wextra wcstombs_test.c -o wcstombs_test |
| 13 |
====> test wcstombs() UTF-8 |
| 14 |
LC_ALL=en_US.UTF-8 ./wcstombs_test |
| 15 |
E8 90 A8 00 00 |
| 16 |
PASS |
| 17 |
====> test wcstombs() GB18030 |
| 18 |
LC_ALL=zh_CN.GB18030 ./wcstombs_test |
| 19 |
C8 F8 00 00 00 |
| 20 |
PASS |
| 21 |
|