Re: Problem with Pango displaying Greek letters under Linux



On Wed, 1 Mar 2006, Nick Chorley wrote:

> Thanks for the reply, Behdad. What is the correct way to do this? I can't
> work out what I need to pass for the first argument of g_unichar_to_utf8().
> The GLib reference isn't very clear, it just tells me that a gunichar is "a
> type which can hold any UCS-4 character code". I've tried something like the
> following:
>
> gchar *greekString;
> g_unichar_to_utf8(03B1, greekString);,
>
> which won't compile. I found an example on the web that has
>
> g_unichar_to_utf8(0x399, buffer);
>
> and while this compiles, the program seg faults when I try to run it.

Something like:

char buf[7];
int len;

len = g_unichar_to_utf8 (0x03B1, buf);
buf[len] = '\0';

Or simply look up the UTF-8 representation of U+03B1 in gucharmap
and use "\316\261".

behdad


> Thanks again for the reply!
>
> Nick
>
> On 3/1/06, Behdad Esfahbod <behdad cs toronto edu> wrote:
>
> > The interpretation of such a thing pretty much depends on your
> > compiler, but most probably this doesn't generate what you have
> > in mind, or at list not on your Linux.  Try using
> > g_unichar_to_utf8 instead.
> >
> > behdad
> >
> >
>

--behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
	-- Dan Bern, "New American Language"



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