glib-2.2.1: g_print() with UTF-8 characters

2003-03-02 Thread Ulf Karlsson
Hi, I'm trying to print strings containing swedish characters in columns by doing g_print("%-16s%-16s\n", "Hallå", "Världen"); The problem seems to be that vasprintf isn't UTF-8-aware and counts the swedish UTF-8 character as two characters and thus only adds 10 whitespaces after the fir

Re: glib-2.2.1: g_print() with UTF-8 characters

2003-03-02 Thread Matthias Clasen
> Hi, > > I'm trying to print strings containing swedish characters in columns > by doing > > g_print("%-16s%-16s\n", "Hallå", "Världen"); > > The problem seems to be that vasprintf isn't UTF-8-aware and counts > the swedish UTF-8 character as two characters and thus only adds 10 > white

Re: glib-2.2.1: g_print() with UTF-8 characters

2003-03-02 Thread Owen Taylor
On Sat, 2003-03-01 at 13:20, Ulf Karlsson wrote: > Hi, > > I'm trying to print strings containing swedish characters in columns > by doing > > g_print("%-16s%-16s\n", "Hallå", "Världen"); > > The problem seems to be that vasprintf isn't UTF-8-aware and counts > the swedish UTF-8 characte

Re: glib-2.2.1: g_print() with UTF-8 characters

2003-03-05 Thread Ulf Karlsson
Hi, Thanks for your suggestions. > Notes here: > > - Glibc has a "feature" where %Ns actually checks for a whole >number of characters in the current encoding. So, unless you >are sure you are always going to be in an UTF-8 locale, avoid >using %Ns. (You are basically OK for iso-88

Re: glib-2.2.1: g_print() with UTF-8 characters

2003-03-05 Thread Sven Neumann
Hi, Ulf Karlsson <[EMAIL PROTECTED]> writes: > > - Glibc has a "feature" where %Ns actually checks for a whole > >number of characters in the current encoding. So, unless you > >are sure you are always going to be in an UTF-8 locale, avoid > >using %Ns. (You are basically OK for iso

Re: glib-2.2.1: g_print() with UTF-8 characters

2003-03-05 Thread Ulf Karlsson
Hi, > > > - Glibc has a "feature" where %Ns actually checks for a whole > > >number of characters in the current encoding. So, unless you > > >are sure you are always going to be in an UTF-8 locale, avoid > > >using %Ns. (You are basically OK for iso-8859-1, but will > > >have pr