Re: [Vala] string - bytes conversion in Vala

2011-01-04 Thread Sandino Flores Moreno
Problem with casting string to/from char*is that in utf8, some characters are actually two-byte sized. That's why glib has a specialized API for dealing with utf8, like the function g_utf8_find_next_char. On Wed, Dec 29, 2010 at 5:59 PM, Anatol Pomozov anatol.pomo...@gmail.com wrote: On Wed,

Re: [Vala] string - bytes conversion in Vala

2011-01-04 Thread Frederik
On 12/23/2010 09:37 AM, Anatol Pomozov wrote: Hi, I manipulate with strings in my application such as storing/reading to/from binary files. And I need to convert a string to/from array of bytes. What is the best way of doing it in Vala? Looking into string class

Re: [Vala] string - bytes conversion in Vala

2011-01-04 Thread Jaroslav Šmíd
not two-byte sized, but they can have 1-4 bytes. On 01/04/2011 06:45 PM, Sandino Flores Moreno wrote: Problem with casting string to/from char*is that in utf8, some characters are actually two-byte sized. That's why glib has a specialized API for dealing with utf8, like the function

Re: [Vala] string - bytes conversion in Vala

2011-01-04 Thread Jaroslav Šmíd
I've reported bug month ago about string conversion funtions (like g_iconv). I don't know if they fixed it. Before you use it, check bugzilla if solved (can't remember bug #). On 12/30/2010 12:51 AM, Anatol Pomozov wrote: Hi On Thu, Dec 23, 2010 at 12:37 AM, Anatol Pomozov

Re: [Vala] string - bytes conversion in Vala

2010-12-29 Thread Anatol Pomozov
Hi On Thu, Dec 23, 2010 at 12:37 AM, Anatol Pomozov anatol.pomo...@gmail.com wrote: Hi, I manipulate with strings in my application such as storing/reading to/from binary files. And I need to convert a string to/from array of bytes. What is the best way of doing it in Vala? Looking into

Re: [Vala] string - bytes conversion in Vala

2010-12-29 Thread Anatol Pomozov
On Wed, Dec 29, 2010 at 3:51 PM, Anatol Pomozov anatol.pomo...@gmail.com wrote: Hi On Thu, Dec 23, 2010 at 12:37 AM, Anatol Pomozov anatol.pomo...@gmail.com wrote: Hi, I manipulate with strings in my application such as storing/reading to/from binary files. And I need to convert a string

[Vala] string - bytes conversion in Vala

2010-12-23 Thread Anatol Pomozov
Hi, I manipulate with strings in my application such as storing/reading to/from binary files. And I need to convert a string to/from array of bytes. What is the best way of doing it in Vala? Looking into string class http://valadoc.org/glib-2.0/string.html I see a method called string#to_utf8()