chiark / gitweb /
Fixed text corruption problem in marketcheck.
authorHenrik Tunedal <tunedal@gmail.com>
Thu, 27 Jan 2011 18:59:57 +0000 (19:59 +0100)
committerHenrik Tunedal <tunedal@gmail.com>
Thu, 27 Jan 2011 18:59:57 +0000 (19:59 +0100)
The problem was due to marketcheck using DataInputStream.readLine(),
which is a fundamentally broken function and has been deprecated since
Java 1.1. Strings in Java consist of Unicode characters, not bytes.

marketcheck/test.java
metadata/com.android.inputmethod.norwegian.txt
metadata/org.abrantix.rockon.rockonnggl.txt

index 9698ac68f2556db1d9e89d68461420b28fca068c..2a34a67d7a8b05df29badb42da7791746971900d 100644 (file)
@@ -61,15 +61,15 @@ class test {
                                 App app = response.getAppList().get(0);\r
                                 String filespec = "../metadata/" + app.getPackageName() + ".txt";\r
                                 FileInputStream fi = new FileInputStream(filespec);\r
-                                BufferedInputStream bi = new BufferedInputStream(fi);\r
-                                DataInputStream di = new DataInputStream(bi);\r
+                                InputStreamReader isr = new InputStreamReader(fi, "UTF-8");\r
+                                BufferedReader br = new BufferedReader(isr);\r
                                 StringBuilder output = new StringBuilder();\r
                                 boolean changed = false;\r
                                 boolean vercodefound = false;\r
                                 boolean versionfound = false;\r
                                 String line, newline;\r
-                                while (di.available() != 0) {\r
-                                    line = di.readLine();\r
+                                while (br.ready()) {\r
+                                    line = br.readLine();\r
                                     if (line.startsWith("Market Version:")) {\r
                                         versionfound = true;\r
                                         newline="Market Version:" + app.getVersion();\r
@@ -87,8 +87,8 @@ class test {
                                     }\r
                                     output.append(line + "\n");\r
                                 }\r
-                                di.close();\r
-                                bi.close();\r
+                                br.close();\r
+                                isr.close();\r
                                 fi.close();\r
                                 if(!versionfound) {\r
                                     changed = true;\r
index e4044795a45110e5155a23e67bf8c8b2cf04f370..713a8c9b8f3a4327f5f976f8dc88c841af3d11de 100644 (file)
@@ -6,7 +6,7 @@ Summary:Keyboard for Scandinavian languages
 Description:
 A modified version of the standard onscreen keyboard in Android
 with support for Norwegian, Swedish, Danish, Faroese, German,
-Icelandic and Northern SÃ\83¡mi keyboard layouts.
+Icelandic and Northern Sámi keyboard layouts.
 .
 Repo Type:svn
 Repo:http://scandinavian-keyboard.googlecode.com/svn/trunk
index 04e7fb164736391f462bb13f3dcd5b26858a56b6..af2a248b5e963a4959d9d4834c4e676bd3715b45 100644 (file)
@@ -4,7 +4,7 @@ Source Code:http://github.com/fabrantes/rockonnggl
 Issue Tracker:http://github.com/fabrantes/rockonnggl/issues
 Summary:Music player
 Description:
-A music player. Cubed, also known as Ã\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\82Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82Â\82Ã\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\82Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82Â\82Ã\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\82Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82Â\82Ã\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82Â\82Ã\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\82Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82³, has possibly the silliest choice of application
+A music player. Cubed, also known as ³, has possibly the silliest choice of application
 name ever.
 .
 Market Version:1.0.81