[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MirBSD mbtowc bug? failure on test-wcrtomb

From: Paolo Bonzini
Subject: Re: MirBSD mbtowc bug? failure on test-wcrtomb
Date: Sun, 24 Oct 2010 16:06:15 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100907 Fedora/3.1.3-1.fc13 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.3

On 10/24/2010 02:20 AM, Thorsten Glaser wrote:
a minimally POSIX compliant setlocale() function ought to return NULL when
asked to set such a locale.

But the system doesn’t even know about charsets.

But it can be as simple as

set = strchr (locale, ".");
if (!set
    || !strcmp (set, ".UTF-8")  || !strcmp (set, ".utf-8")
    || !strcmp (set, ".UTF8")   || !strcmp (set, ".utf8")
    || !strcmp (set, ".OPTU-8") || !strcmp (set, ".optu-8")
    || !strcmp (set, ".OPTU8")  || !strcmp (set, ".optu8"))
  return locale;

return NULL;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]