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: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: inexplicable generate_packets error
From: Jason Dorje Short <jdorje@xxxxxxxxxxxx>
Date: Tue, 27 Apr 2004 12:09:16 -0400

Raimar Falke wrote:
On Tue, Apr 27, 2004 at 02:10:03AM -0400, Jason Dorje Short wrote:

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.

But how do you know which are which?


A assume that the internal encoding for the server is known and may be
different to the network encoding. So you have to convert both types
anyway.

1. No, the internal encoding for the server need not be different from the network encoding.

2. There is no reason you'd need to convert ascii anyway. Doing so is a bad idea.

3. Even if you did have to convert both types, you'd still need to know which was which since they have to be converted differently.

And why do you want to turn ascii into utf-16 and double the network packet size?

Because it is better for the maintainability that you only have one
type. It may be better to use utf-8 for the network. Tests have to
done.

But this is impossible anyway since we _don't_ have only one type.

IMO we are therefore better off making a clean split. This assures that everyone knows just which type of string they are dealing with.

jason


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