This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: codeset problems in wprintf and wcsftime


> another alternative to the solutions you outlined
> might be to store those strings as wchar versions only, to be used
> directly in wprintf and converted to the LC_CTYPE character set when
> needed in printf. That way, the user would always get readable output.
>
>> - Store the charset not only for LC_CTYPE, but for each localization
>> Âcategory, and provide a function to request the charset.
>> ÂThis also requires to store the associated multibyte to widechar
>> Âconversion functions, obviously, and to call the correct functions
>> Âfrom wprintf and wcftime.
>>
>> - Redefine the locale data structs so that they contain multibyte and
>> Âwidechar representations of all strings. ÂUse the multibyte strings
>> Âin the multibyte functions, the widechar strings in the widechar
>> Âfunctions.

Actually, there's a fourth alternative: do nothing.

>From http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html:
"If different character sets are used by the locale categories, the
results achieved by an application utilizing these categories are
undefined."

(So why did they even allow different charsets to be specified for
different categories!?)

Andy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]