Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] Re: (PR#2559) Forget one thing
Home

[Freeciv-Dev] Re: (PR#2559) Forget one thing

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bernd.korz@xxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2559) Forget one thing
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 28 Jan 2003 10:34:28 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Bernd Korz via RT wrote:
> The problem ist that BeOS can not manage not staic bytes for Fonts so we 
> need fixed ones, but jdore can declear this better then me.

Davide ran into a similar thing on an Alpha platform.

The problem that we eventually found is that UTF-16 can be either 
big-endian or little-endian.  The first byte of the string indicates 
which: either 0xffef or 0xefff.  And it appears this endian-ness is not 
dependent on the endian-ness of the machine.

Rafal thought this first byte was a bug in iconv, and just skipped over 
it.  If only I had noticed that sooner...

The solution is not to use UTF-16, but to use UTF-16LE.  This way we are 
assured the ordering will be little-endian, which is (apparently) what 
SDL_ttf expects.  It is almost as easy as changing "UTF-16" to 
"UTF-16LE" in client/gui-sdl/gui_iconv.c, except then you end up with 
several variants of segfault because the first (endian) byte is no 
longer present, while the conversion code expects it to be.

This solution has been tested on Davide's alpha machine, but not yet on 
Bernd's BeOS machine.

As soon as CVS is accessible I will provide a patch...

jason




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