Re: [Vala] how can I get the number of unicode points in a string?



From: "琉璃井" <pharaoh456 163 com>
Date: 2011-04-03 18:15:12
To: "Luca Bruno" <lethalman88 gmail com>
Subject: Re:Re: [Vala] how can I get the number of unicode points in a string?

At 2011-04-03 16:06:32,"Luca Bruno" <lethalman88 gmail com> wrote:

On Sun, Apr 03, 2011 at 03:59:23PM +0800, 琉璃井 wrote:
I see that since 0.11.0 vala string.length returns number of bytes rather than that of unicode characters, 
and string[i] returns only one byte. I wonder how to deal with east Asian character strings.

There are other methods in string that deal with utf8. For example
char_count() and next_char().


thank you.
I find char_count(), get_char() and next_char() in gtk+ document.
Looks like these methods are not covered in vala tutorial and document.
Is there something like string[i] for index access to utf8? I didn't get it in docs.




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