Fixed text corruption problem in marketcheck.

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.
This commit is contained in:
Henrik Tunedal 2011-01-27 19:59:57 +01:00
parent 635555827d
commit 6fd360e62d
3 changed files with 8 additions and 8 deletions

View file

@ -61,15 +61,15 @@ class test {
App app = response.getAppList().get(0); App app = response.getAppList().get(0);
String filespec = "../metadata/" + app.getPackageName() + ".txt"; String filespec = "../metadata/" + app.getPackageName() + ".txt";
FileInputStream fi = new FileInputStream(filespec); FileInputStream fi = new FileInputStream(filespec);
BufferedInputStream bi = new BufferedInputStream(fi); InputStreamReader isr = new InputStreamReader(fi, "UTF-8");
DataInputStream di = new DataInputStream(bi); BufferedReader br = new BufferedReader(isr);
StringBuilder output = new StringBuilder(); StringBuilder output = new StringBuilder();
boolean changed = false; boolean changed = false;
boolean vercodefound = false; boolean vercodefound = false;
boolean versionfound = false; boolean versionfound = false;
String line, newline; String line, newline;
while (di.available() != 0) { while (br.ready()) {
line = di.readLine(); line = br.readLine();
if (line.startsWith("Market Version:")) { if (line.startsWith("Market Version:")) {
versionfound = true; versionfound = true;
newline="Market Version:" + app.getVersion(); newline="Market Version:" + app.getVersion();
@ -87,8 +87,8 @@ class test {
} }
output.append(line + "\n"); output.append(line + "\n");
} }
di.close(); br.close();
bi.close(); isr.close();
fi.close(); fi.close();
if(!versionfound) { if(!versionfound) {
changed = true; changed = true;

View file

@ -6,7 +6,7 @@ Summary:Keyboard for Scandinavian languages
Description: Description:
A modified version of the standard onscreen keyboard in Android A modified version of the standard onscreen keyboard in Android
with support for Norwegian, Swedish, Danish, Faroese, German, with support for Norwegian, Swedish, Danish, Faroese, German,
Icelandic and Northern Sámi keyboard layouts. Icelandic and Northern Sámi keyboard layouts.
. .
Repo Type:svn Repo Type:svn
Repo:http://scandinavian-keyboard.googlecode.com/svn/trunk Repo:http://scandinavian-keyboard.googlecode.com/svn/trunk

View file

@ -4,7 +4,7 @@ Source Code:http://github.com/fabrantes/rockonnggl
Issue Tracker:http://github.com/fabrantes/rockonnggl/issues Issue Tracker:http://github.com/fabrantes/rockonnggl/issues
Summary:Music player Summary:Music player
Description: Description:
A music player. Cubed, also known as ³, has possibly the silliest choice of application A music player. Cubed, also known as ³, has possibly the silliest choice of application
name ever. name ever.
. .
Market Version:1.0.81 Market Version:1.0.81