Opened 14 years ago

Closed 13 years ago

#240 closed defect (fixed)

libc: code set of setlocale() and nl_langinfo()

Reported by: KO Myung-Hun Owned by: bird
Priority: normal Milestone: libc-0.6.5
Component: libc Version: 0.6
Severity: normal Keywords:
Cc:

Description

Hi/2.

Currently, setlocale(LC_xxx, "") and nl_langinfo(CODESET) return ISO8859-1 for a codeset of ko_KR when the codeset is not specified in LC_xxx or LANG env. var.

But this is not correct.

It should be EUC-KR, IBM-949, or CP949.

I think, this is true for other DBCS locale.

How about using CPxxx for a codeset when it is not specified in LC_xxx or LANG env. var. ?

I prefer CPxxx to IBM-xxx, because it can be used with GNU libraries such as libiconv.

Change History (2)

comment:1 by bird, 13 years ago

Status: newassigned
Summary: codeset of setlocale() and nl_langinfo()libc: code set of setlocale() and nl_langinfo()
Version: 0.6

The ISO8859-1 is the default code set of the locale according to the IBM locale API. So, if you want to make sure you're using the right code set, I would suggest trying to change LC_xxx / LANG to ko_KR.IBM949 (or whatever most apps will understand).

Hmm.... It's actually tempting to just use the process code page when LC_xxx / LANG does not specify any code set. This would help for #227 as well. I'll see how much work this is and try get it into the next bug fix release.

comment:2 by bird, 13 years ago

Resolution: fixed
Status: assignedclosed

r3788 make setlocale default to the process code page when no codeset is given in the locale specification. (Very easy change as there was already code for doing exactly this.)

Note: See TracTickets for help on using tickets.