public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Thomas Zander <zander@kde.org>
To: mauve-discuss@sources.redhat.com
Cc: Michael Koch <konqueror@gmx.de>
Subject: locales test has non ascii chars..
Date: Thu, 30 Dec 2004 12:07:00 -0000	[thread overview]
Message-ID: <200412301307.07714.zander@kde.org> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 478 bytes --]

Hi,

I'm having trouble getting the localeTest class to compile correctly since 
it has non-ascii chars.  And lots of them :}

I suggest to filter the java file and replace the non ascii values with 
their \u00xx values instead.

See the attached patch and the class to generate this change.  I'm worried 
about the code on lines 410-414 which contains lots of non-standard chars. 
Maybe a typo?

Anyway; can you pick this up?  Or can I commit?
-- 
Thomas Zander

[-- Attachment #1.2: Convert.java --]
[-- Type: text/x-java, Size: 1516 bytes --]

import java.util.*;
import java.io.*;

public class Convert {
    public static void main(String[] args) throws IOException {
        if(args.length == 0) {
            System.out.println("Provide filesnames on commandline");
            return;
        }
        for(int i=0; i < args.length; i++) {
            convert(args[i]);
        }
    }

    private static void convert(String filename) throws IOException {
        File one = new File(filename);
        if(! one.exists())
            return;
        File two = new File(filename +"~");
        int count=1;
        while(two.exists()) {
            two = new File(filename + String.valueOf(count++) +"~");
        }
        Reader reader = new InputStreamReader(new FileInputStream(one), "ISO-8859-1");
        Writer writer = new FileWriter(two);
        try {
            while(true) {
                int character = reader.read();
                if(character == -1)
                    break;
                if(character < 128)
                    writer.write((char) character);
                else {
                    writer.write("\\u");
                    String val = Integer.toString((int) ((char) character), 16);
                    for(int i=4; i > val.length(); i--)
                        writer.write("0");
                    writer.write(val);
                }
            }
        } catch(IOException e) {
            two.delete();
        } finally {
            reader.close();
            writer.close();
        }
    }
}

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: locales_charset.diff --]
[-- Type: text/x-diff; charset="us-ascii"; name="locales_charset.diff", Size: 7492 bytes --]

Index: gnu/testlet/locales/LocaleTest.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/locales/LocaleTest.java,v
retrieving revision 1.1
diff -u -3 -p -r1.1 LocaleTest.java
--- gnu/testlet/locales/LocaleTest.java	26 Dec 2004 17:02:16 -0000	1.1
+++ gnu/testlet/locales/LocaleTest.java	30 Dec 2004 12:04:30 -0000
@@ -271,7 +271,7 @@ public class LocaleTest
 		new ExpectedValues("de", "DE", "", "de_DE", "deu", "DEU",
 			           "Deutsch", "Deutschland", "", "Deutsch (Deutschland)",
 				   "EUR", 2, "\u20ac"),
-		new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. März 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
+		new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. M\u00e4rz 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"),
 		new ExpectedNumberValues("1.000,00 \u20ac", "1.000.000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10.000.000,12 \u20ac"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100", "10.000.000"),
@@ -280,9 +280,9 @@ public class LocaleTest
     // Locale: Belgium
     checkLocale(h, new Locale("fr", "BE"),
 		new ExpectedValues("fr", "BE", "", "fr_BE", "fra", "BEL",
-				   "Französisch", "Belgien", "", "Französisch (Belgien)",
+				   "Franz\u00f6sisch", "Belgien", "", "Franz\u00f6sisch (Belgien)",
 				   "EUR", 2, "\u20ac"),
-		new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. März 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
+		new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. M\u00e4rz 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"),
 		new ExpectedNumberValues("1.000,00 \u20ac", "1.000.000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10.000.000,12 \u20ac"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100", "10.000.000"),
@@ -295,7 +295,7 @@ public class LocaleTest
 		new ExpectedValues("el", "GR", "", "el_GR", "ell", "GRC",
 				   "Griechisch", "Griechenland", "", "Griechisch (Griechenland)",
 				   "EUR", 2, "\u20ac"),
-		new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. März 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
+		new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. M\u00e4rz 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"),
 		new ExpectedNumberValues("1.000,00 \u20ac", "1.000.000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10.000.000,12 \u20ac"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100", "10.000.000"),
@@ -307,7 +307,7 @@ public class LocaleTest
 		new ExpectedValues("en", "IE", "", "en_IE", "eng", "IRL",
 				   "Englisch", "Irland", "", "Englisch (Irland)",
 				   "EUR", 2, "\u20ac"),
-		new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. März 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
+		new ExpectedDateValues("18.03.1974", "18.03.74", "18.03.1974", "18. M\u00e4rz 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"),
 		new ExpectedNumberValues("1.000,00 \u20ac", "1.000.000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10.000.000,12 \u20ac"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100", "10.000.000"),
@@ -316,7 +316,7 @@ public class LocaleTest
     // Locale: France
     checkLocale(h, new Locale("fr", "FR"),
 		new ExpectedValues("fr", "FR", "", "fr_FR", "fra", "FRA",
-				   "Französisch", "Frankreich", "", "Französisch (Frankreich)",
+				   "Franz\u00f6sisch", "Frankreich", "", "Franz\u00f6sisch (Frankreich)",
 				   "EUR", 2, "\u20ac"),
 		null,
 		null,
@@ -360,7 +360,7 @@ public class LocaleTest
     // Locale: The Netherlands
     checkLocale(h, new Locale("nl", "NL"),
 		new ExpectedValues("nl", "NL", "", "nl_NL", "nld", "NLD",
-				   "Niederländisch", "Niederlande", "", "Niederländisch (Niederlande)",
+				   "Niederl\u00e4ndisch", "Niederlande", "", "Niederl\u00e4ndisch (Niederlande)",
 				   "EUR", 2, "\u20ac"),
 		new ExpectedDateValues("18-mrt-1974", "18-3-74", "18-mrt-1974", "18 maart 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"),
@@ -371,7 +371,7 @@ public class LocaleTest
     // Locale: Luxemborg
     checkLocale(h, new Locale("fr", "LU"),
 		new ExpectedValues("fr", "LU", "", "fr_LU", "fra", "LUX",
-				   "Französisch", "Luxemburg", "", "Französisch (Luxemburg)",
+				   "Franz\u00f6sisch", "Luxemburg", "", "Franz\u00f6sisch (Luxemburg)",
 				   "EUR", 2, "\u20ac"),
 		null,
 		null,
@@ -382,7 +382,7 @@ public class LocaleTest
     // Locale: United Kingdom
     checkLocale(h, Locale.UK,
 		new ExpectedValues("en", "GB", "", "en_GB", "eng", "GBR",
-				   "Englisch", "Vereinigtes Königreich", "", "Englisch (Vereinigtes Königreich)",
+				   "Englisch", "Vereinigtes K\u00f6nigreich", "", "Englisch (Vereinigtes K\u00f6nigreich)",
 				   "GBP", 2, "GBP"),
 		new ExpectedDateValues("18-Mar-1974", "18/03/74", "18-Mar-1974", "18 March 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
 		new ExpectedNumberValues("1,000", "1,000,000", "100", "100.123", "10,000,000.123"),
@@ -407,15 +407,15 @@ public class LocaleTest
 				   "Finnisch", "Finnland", "", "Finnisch (Finnland)",
 				   "EUR", 2, "EUR"),
 		new ExpectedDateValues("18.3.1974", "18.3.1974", "18.3.1974", "18. maaliskuuta 1974", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
-		new ExpectedNumberValues("1 000", "1 000 000", "100", "100,123", "10 000 000,123"),
-		new ExpectedNumberValues("1 000,00 \u20ac", "1 000 000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10 000 000,12 \u20ac"),
-		new ExpectedNumberValues("1 000", "1 000 000", "100", "100", "10 000 000"),
-		new ExpectedNumberValues("1 000", "1 000 000", "100", "100,123", "10 000 000,123"),
-		new ExpectedNumberValues("100 000%", "100 000 000%", "10 000%", "10 012%", "1 000 000 012%"));
+		new ExpectedNumberValues("1\u00a0000", "1\u00a0000\u00a0000", "100", "100,123", "10\u00a0000\u00a0000,123"),
+		new ExpectedNumberValues("1\u00a0000,00 \u20ac", "1\u00a0000\u00a0000,00 \u20ac", "100,00 \u20ac", "100,12 \u20ac", "10\u00a0000\u00a0000,12 \u20ac"),
+		new ExpectedNumberValues("1\u00a0000", "1\u00a0000\u00a0000", "100", "100", "10\u00a0000\u00a0000"),
+		new ExpectedNumberValues("1\u00a0000", "1\u00a0000\u00a0000", "100", "100,123", "10\u00a0000\u00a0000,123"),
+		new ExpectedNumberValues("100\u00a0000%", "100\u00a0000\u00a0000%", "10\u00a0000%", "10\u00a0012%", "1\u00a0000\u00a0000\u00a0012%"));
     // Locale: Turkey
     checkLocale(h, new Locale("tr", "TR"),
 		new ExpectedValues("tr", "TR", "", "tr_TR", "tur", "TUR",
-				   "Türkisch", "Türkei", "", "Türkisch (Türkei)",
+				   "T\u00fcrkisch", "T\u00fcrkei", "", "T\u00fcrkisch (T\u00fcrkei)",
 				   "TRL", 2, "TRL"),
 		new ExpectedDateValues("18.Mar.1974", "18.03.1974", "18.Mar.1974", "18 Mart 1974 Pazartesi", "17:20:30", "17:20", "17:20:30", "17:20:30 CET"),
 		new ExpectedNumberValues("1.000", "1.000.000", "100", "100,123", "10.000.000,123"),

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2004-12-30 12:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-30 12:07 Thomas Zander [this message]
2004-12-30 12:17 ` Michael Koch
2004-12-30 13:23   ` Thomas Zander
2004-12-30 13:52     ` Michael Koch
2004-12-30 14:17       ` Thomas Zander
2004-12-30 14:36         ` Michael Koch
2004-12-31  9:39           ` Thomas Zander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200412301307.07714.zander@kde.org \
    --to=zander@kde.org \
    --cc=konqueror@gmx.de \
    --cc=mauve-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).