gnokii-users
[Top][All Lists]
Advanced

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

Re: Unicode support


From: Pawel Kot
Subject: Re: Unicode support
Date: Fri, 27 Sep 2002 09:07:59 +0200 (CEST)

On Fri, 27 Sep 2002, Hu Gang wrote:

> good propose. It look very cool.
>
> Here is the patch.

The same note:
+               case 2: /* the value is multi byte
+                        * so can check the before character */
+                       if ( *(dest - 1) == '?' ) {
+                               *(dest - 1) = *dest;
+                               *(dest)     = *(dest + 1);
+                               return 1;
+                       }

I think I don't get it. Why do we even touch *(dest-1)? It may be outside
our process address space. My understanding of the wctomb is that we give
it some encoded wide character. And we get the string that may be 1
character long, 2 characters long, up to MB_CUR_MAX characters long.
So we store it in the dest. And move the pointer the length - 1 bytes, as
the loop iteration will move it one byte further.

So the question: why do we even bother with '2' value? I think we don't
need to do this at all. But I just woke up, care to enlighten me what do
I miss?

pkot
-- 
mailto:address@hidden :: mailto:address@hidden
http://kt.linuxnews.pl/ :: Kernel Traffic po polsku





reply via email to

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