This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: UTF-8, UTF-16 and UTF-32


On Fri, Aug 22, 2008 at 22:36, Dallas Clarke <DClarke@unwired.com.au> wrote:
> Hello Scott,
>
> wchar_t* strchr(wchar_t *string, wchar_t chr){
>   while(*string != '\0' && *string != chr) ++string;
>   if(*string == chr) return string;
>   return NULL;
> }
>

That doesn't work.  What if I want to look for ð, U+1D505
MATHEMATICAL FRAKTUR CAPITAL B?  It's UTF-16 representation is 0xD835
0xDD05, which obviously doesn't fit in the single wchar_t parameter.

~ Scott

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