Reputation: 11317
I am trying to convert UTF-8 string to C/POSIX locale string
The UTF-8 string is "abc123£" (in bash "abc123\302\243"`)
iconv() is returning EILSEQ to me in case 1, but success in case 2.
What is the reason for this?
Also, how can I successfully convert any UTF-8 string to 'C' locale string.
Upvotes: 1
Views: 1138
Reputation: 240829
Because your C
locale uses a character set (probably US-ASCII) that doesn't have a character for £
, and the string can't be converted without loss.
Upvotes: 1