[cal10n-dev] branch, master, updated. v0.6.5-4-g975f8f7

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Thu Sep 3 22:00:57 CEST 2009


The branch, master has been updated
       via  975f8f73e55bf77415329423c298c164ab611c87 (commit)
      from  f16af567f71512382ea7d4a64be94949552cf7e4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=cal10n.git;a=commit;h=975f8f73e55bf77415329423c298c164ab611c87
http://github.com/ceki/cal10n/commit/975f8f73e55bf77415329423c298c164ab611c87

commit 975f8f73e55bf77415329423c298c164ab611c87
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Thu Sep 3 21:58:22 2009 +0200

    Testing UTF8 encodings as well

diff --git a/cal10n-api/src/test/java/ch/qos/cal10n/util/ResourceBundleEncodingTest.java b/cal10n-api/src/test/java/ch/qos/cal10n/util/ResourceBundleEncodingTest.java
index 98d3f0c..9975cae 100644
--- a/cal10n-api/src/test/java/ch/qos/cal10n/util/ResourceBundleEncodingTest.java
+++ b/cal10n-api/src/test/java/ch/qos/cal10n/util/ResourceBundleEncodingTest.java
@@ -41,17 +41,16 @@ import ch.qos.cal10n.Cal10nTestConstants;
  */
 public class ResourceBundleEncodingTest {
 
-  
   // Useful links:
-  
+
   // http://www.terena.org/activities/multiling/ml-docs/iso-8859.html
-    
+
   Map<String, String> map = new HashMap<String, String>();
   Map<String, String> witness = new HashMap<String, String>();
 
   // encoding for Greek "ISO8859_7"
   @Test
-  public void greek() throws IOException {
+  public void greek_ISO8859_7() throws IOException {
     FileInputStream fis = new FileInputStream(Cal10nTestConstants.TEST_CLASSES
         + "/encodingsISO8859/a_el_GR.properties");
     Reader reader = new InputStreamReader(fis, "ISO8859_7");
@@ -69,25 +68,59 @@ public class ResourceBundleEncodingTest {
 
     assertEquals(witness, map);
   }
-  
-  
+
   // encoding for Turkish "ISO8859_3"
   @Test
-  public void turkish() throws IOException {
-    FileInputStream fis = new FileInputStream(Cal10nTestConstants.TEST_CLASSES+"/encodingsISO8859/a_tr_TR.properties");
+  public void turkishISO8859_3() throws IOException {
+    FileInputStream fis = new FileInputStream(Cal10nTestConstants.TEST_CLASSES
+        + "/encodingsISO8859/a_tr_TR.properties");
     Reader reader = new InputStreamReader(fis, "ISO8859_3");
-    Parser parser  = new Parser(reader, map);
+    Parser parser = new Parser(reader, map);
+    parser.parseAndPopulate();
+
+    // 0xBA 0x015F # LATIN SMALL LETTER S WITH CEDILLA
+    char sCedilla = '\u015F';
+
+    // 0xB9 0x0131 # LATIN SMALL LETTER DOTLESS I
+    char iDotless = '\u0131';
+
+    // nisan pronounced (nIshan)
+    String witnessValue = "n" + iDotless + sCedilla + "an";
+    witness.put("A", witnessValue);
+    assertEquals(witness, map);
+  }
+  
+  @Test
+  public void greek_UTF8() throws IOException {
+    FileInputStream fis = new FileInputStream(Cal10nTestConstants.TEST_CLASSES
+        + "/encodingsUTF8/a_el_GR.properties");
+    Reader reader = new InputStreamReader(fis, "UTF8");
+    Parser parser = new Parser(reader, map);
     parser.parseAndPopulate();
+
+    String alpha = "\u03b1";
+    witness.put("A", alpha);
+
+    assertEquals(witness, map);
+  }
   
-    // 0xBA   0x015F  # LATIN SMALL LETTER S WITH CEDILLA
+  @Test
+  public void turkishUTF8() throws IOException {
+    FileInputStream fis = new FileInputStream(Cal10nTestConstants.TEST_CLASSES
+        + "/encodingsUTF8/a_tr_TR.properties");
+    Reader reader = new InputStreamReader(fis, "UTF8");
+    Parser parser = new Parser(reader, map);
+    parser.parseAndPopulate();
+
+    // 0xBA 0x015F # LATIN SMALL LETTER S WITH CEDILLA
     char sCedilla = '\u015F';
-    
-    // 0xB9 0x0131  # LATIN SMALL LETTER DOTLESS I
+
+    // 0xB9 0x0131 # LATIN SMALL LETTER DOTLESS I
     char iDotless = '\u0131';
-    
-    // nisan  pronounced (nIshan)
-    String witnessValue = "n"+iDotless+sCedilla+"an";
+
+    // nisan pronounced (nIshan)
+    String witnessValue = "n" + iDotless + sCedilla + "an";
     witness.put("A", witnessValue);
     assertEquals(witness, map);
-    }
+  }
 }
diff --git a/cal10n-api/src/test/resources/encodingsUTF8/a_el_GR.properties b/cal10n-api/src/test/resources/encodingsUTF8/a_el_GR.properties
new file mode 100644
index 0000000..432c470
--- /dev/null
+++ b/cal10n-api/src/test/resources/encodingsUTF8/a_el_GR.properties
@@ -0,0 +1 @@
+A=α
\ No newline at end of file
diff --git a/cal10n-api/src/test/resources/encodingsUTF8/a_tr_TR.properties b/cal10n-api/src/test/resources/encodingsUTF8/a_tr_TR.properties
new file mode 100644
index 0000000..f2eb98c
--- /dev/null
+++ b/cal10n-api/src/test/resources/encodingsUTF8/a_tr_TR.properties
@@ -0,0 +1 @@
+A=nışan

-----------------------------------------------------------------------

Summary of changes:
 .../cal10n/util/ResourceBundleEncodingTest.java    |   65 +++++++++++++++-----
 .../resources/encodingsUTF8/a_el_GR.properties     |    1 +
 .../resources/encodingsUTF8/a_tr_TR.properties     |    1 +
 3 files changed, 51 insertions(+), 16 deletions(-)
 create mode 100644 cal10n-api/src/test/resources/encodingsUTF8/a_el_GR.properties
 create mode 100644 cal10n-api/src/test/resources/encodingsUTF8/a_tr_TR.properties


hooks/post-receive
-- 
Compiler assisted localization library


More information about the cal10n-dev mailing list