Hi list,

attached you find a patch which allows to use 8bit translation files (e.g. 
de.po) to see correctly the Umlauts.

The previous code mentioned UTF-8, which I see as currently not possible at 
all as the text rendering code and the storage of the character images do not 
handle multi-byte encodings.
So the only translations currently possible is by using ISO-style 8bit encoded 
translation files, e.g. ISO8859-1

Also attached is a first try on the completion of the german translation
(I'm new to the game so some translations might not be perfect - I'll try to 
improve)

Another problem with the translation is:
I don't know if it is currently foreseen in the code to have all files 
translated, e.g. there are files like 
./sequenceaudio/cam1/c001.txt
which I wonder if there is any locale subdir for those foreseen.

If anybody with better knowledge of the code can give me a hint, I'll be very 
happy.

-- 
Best regards/Schöne Grüße

Martin    ()  ascii ribbon campaign - against html mail 
          /\                        - against microsoft attachments

Computers and Internet gave you freedom.
TCPA would TAKE your FREEDOM!  http://www.againsttcpa.com
Index: textdraw.c
===================================================================
--- textdraw.c	(revision 2052)
+++ textdraw.c	(working copy)
@@ -171,10 +171,10 @@
 	IVIS_FONT *Font = &iVFonts[ActiveFontID];
 
 	while (*String!=0) {
-		Index = *String;
+		Index = (unsigned char)*String;
 
 		if(Index != ASCII_COLOURMODE) {
-			if(Index != ASCII_SPACE) { // FIXME Culprit for images in UTF-8 strings?
+			if(Index != ASCII_SPACE) {
 				ImageID = (UWORD)Font->AsciiTable[Index];
 				MaxX += iV_GetImageWidth(Font->FontFile, ImageID) + 1;
 			} else {
@@ -195,7 +195,7 @@
 	int Width = 0;
 	IVIS_FONT *Font = &iVFonts[ActiveFontID];
 
-	Index = Char;
+	Index = (unsigned char)Char;
 
 	if(Index != ASCII_COLOURMODE) {
 		if(Index != ASCII_SPACE) {
@@ -531,7 +531,7 @@
 	pie_BeginTextRender(Font->FontColourIndex);
 
 	while (*string!=0) {
-		Index = *string;
+		Index = (unsigned char)*string;
 
 		// Toggle colour mode?
 		if(Index == ASCII_COLOURMODE) {
@@ -545,7 +545,7 @@
 			}
 		} else if(Index == ASCII_SPACE) {
 			x += Font->FontSpaceSize;
-		} else { // FIXME Culprit for images in UTF-8 strings?
+		} else {
 			ImageID = (UWORD)Font->AsciiTable[Index];
 			pie_TextRender(Font->FontFile, ImageID, x, y);
 			x += iV_GetImageWidth(Font->FontFile, ImageID) + 1;
@@ -577,7 +577,7 @@
 
 	while (*String!=0)
 	{
-		Index = *String;
+		Index = (unsigned char)*String;
 
 		if (Index != ASCII_SPACE) {
 			ImageID = (UWORD)Font->AsciiTable[Index];

Attachment: de.po
Description: application/gettext

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to