Can any body add Russian encoding to WZ?

Discuss the future of Warzone 2100 with us.
Post Reply
User avatar
Speeder
Trained
Trained
Posts: 38
Joined: 09 Aug 2006, 18:57
Contact:

Can any body add Russian encoding to WZ?

Post by Speeder »

We on the www.krossfire.net.ru want to create russian transtalions of WZ 2100, but 2.0.6 do not undarstend russian keyboard, this makes imposible to create russian chat in multyplayer...

Any body can HELP???
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Can any body add Russian encoding to WZ?

Post by lav_coyote25 »

there was talk of this happening... i do not know what the status is at this time...  your best bet is to ask one of the devs...
‎"to prepare for disaster is to invite it, to not prepare for disaster is a fools choice" -me (kim-lav_coyote25-metcalfe) - it used to be attributed to unknown - but adding the last bit , it now makes sense.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Can any body add Russian encoding to WZ?

Post by DevUrandom »

There was a patch to make 8bit codes work. For iso8859-1 at least it seems to work...
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: Can any body add Russian encoding to WZ?

Post by Giel »

I think that instead we should eventually move over to Unicode with UTF-8 encoding since ISO8869-1 (aka Latin-1) is only good for most European languages really.

I was thinking that we maybe would have to use some font rasterisation system as well for this (since storing a bitmap with characters isn't the best option really). I was personally thinking about using GNU Unifont for this.
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Can any body add Russian encoding to WZ?

Post by DevUrandom »

Giel wrote: I think that instead we should eventually move over to Unicode with UTF-8 encoding since ISO8869-1 (aka Latin-1) is only good for most European languages really.

I was thinking that we maybe would have to use some font rasterisation system as well for this (since storing a bitmap with characters isn't the best option really). I was personally thinking about using GNU Unifont for this.
Problem here is that no function in WZ is currently able to handle UTF8. And yes, the fonts would have to be adapted, too. Textured fonts wont work. So a GL TrueType renderer is needed.
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: Can any body add Russian encoding to WZ?

Post by Giel »

DevUrandom wrote: Problem here is that no function in WZ is currently able to handle UTF8.
The only functions that would have to be able to deal with UTF-8 encoding are the display functions and the input functions. ASCII text won't change if encoded in UTF-8. I can easily write up a UTF-8 encoder and decoder (if not less) in about 30 minutes. The real "problem" is the rendering font though. (Also I wouldn't know where to start to take cyrillian characters from a keyboard).

Anyway I'll write some UTF-8 encoding/decoding code tomorrow

DevUrandom wrote: And yes, the fonts would have to be adapted, too. Textured fonts wont work. So a GL TrueType renderer is needed.
Maybe use FreeType to rasterize all used characters of a font ? Then use GNU Unifont as our font (it has _lots_ of characters).
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Can any body add Russian encoding to WZ?

Post by DevUrandom »

You mean this one? http://czyborra.com/
[me=DevUrandom]throws DejaVu in: http://dejavu.sourceforge.net/ (Used by Wesnoth)[/me]

I think we also need to make sure the underlying layers support it. And I know this is not true for PhysFS-1.0: "1.1 only: Fully supports Unicode filenames."
So we may need to bundle one or the other package.

What I wonder as well is whether we need to increase buffer lengths. Eg. Linux's PATH_MAX (which we use to define Windows style MAX_PATH) is long enough with 4096 bytes. But poor Windows has this set a lot smaller, afaik. There are also input buffers and the like. Maybe we need to use Windows Unicode functions (*W) in some places.
Not that this is an issue, but it could turn out to be a little more complex than we initialy think.
Last edited by DevUrandom on 30 Jul 2007, 11:58, edited 1 time in total.
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: Can any body add Russian encoding to WZ?

Post by Giel »

DevUrandom wrote: You mean this one? http://czyborra.com/
yes, quite specifically I mean this: http://czyborra.com/unifont/
GLT (a C++ wrapper for OpenGL) has some tutorials where this font is used to render different texts.
DevUrandom wrote: [me=DevUrandom]throws DejaVu in: http://dejavu.sourceforge.net/ (Used by Wesnoth)[/me]
This seems like a nice font as well. I especially like the monospace, sans serif variant of it.
DevUrandom wrote: I think we also need to make sure the underlying layers support it. And I know this is not true for PhysFS-1.0: "1.1 only: Fully supports Unicode filenames."
So we may need to bundle one or the other package.
DevUrandom wrote: What I wonder as well is whether we need to increase buffer lengths. Eg. Linux's PATH_MAX (which we use to define Windows style MAX_PATH) is long enough with 4096 bytes. But poor Windows has this set a lot smaller, afaik. There are also input buffers and the like.
Dang, I'd very much like the idea of using C++'s std::string here.
DevUrandom wrote: Maybe we need to use Windows Unicode functions (*W) in some places.
Not that this is an issue, but it could turn out to be a little more complex than we initialy think.
Well I do _not_ want to use Windows' Unicode functions if at all possible, firstly these use UTF-16 (little endian variant), secondly they're a pain to work with. So internally I would really want to use UTF-8 instead, plus AFAIK we hardly ever call WinAPI functions, so lets keep it that way.
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
User avatar
mcdebugger
Trained
Trained
Posts: 66
Joined: 02 Feb 2007, 20:54
Location: Russian Federation
Contact:

Re: Can any body add Russian encoding to WZ?

Post by mcdebugger »

Speeder wrote: russian encoding is cp-1251
I think it lives only because of Windows OS. A UTF support would be better for a "world issue" :) It's just my subjective opinion...
Hardware: MacBook Pro 13 2015
Software: macOS 10.15 Catalina
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Can any body add Russian encoding to WZ?

Post by DevUrandom »

Coming nearer with the recent addition of unicode font rendering by Giel.
Gettext also supports utf-8, so if I am not mistaken the "only" part which needs checking is Warzone's internals. (Don't get me wrong, this is still nothing which can be done in 5 minutes...)
Post Reply