Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: inexplicable generate_packets error
Home

[Freeciv-Dev] Re: inexplicable generate_packets error

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: inexplicable generate_packets error
From: Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Tue, 27 Apr 2004 07:36:34 +0200

On Mon, Apr 26, 2004 at 02:25:38PM -0400, Jason Dorje Short wrote:
> Raimar Falke wrote:
> 
> >The type dataio type "string" is hardcoded.
> 
> So I see.  It takes this patch to make the change fully.
> 
> >I think the patch is the wrong direction. There just should not be two
> >string types.
> 
> Perhaps.  But the current method of put_conv_callback/get_conv_callback 
> is broken because it converts all strings, including those which 
> shouldn't be converted.  This can break the GTK client if the network 
> charset is not a superset of ASCII (which probably never happens).
> 
> So the alternative is to make these conversions manually for ALL 
> relevant packet fields.  This can be done either when sending/receiving 
> the packets or when writing/reading data from the GUI.  Either will take 
> many times more code.
> 
> And realize these string types are fundamentally different.  Someday the 
> TEXT packets could use UTF-16.  But the ASCII packets will always be ascii.

I don't see the problem handling both types the same way. I.e. you
wrap your ascii strings in UTF-16 and dewrap them at the receiving
side.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "When C++ is your hammer, everything looks like a thumb."
    -- Steven M. Haflich


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