Wednesday, July 14, 2010

is there any json parser that can parse UTF-8 json text

i tried gson, but it give me error.
this is the code i used

public class Test {
private static final String charEncoding="UTF-8";

private static final String fileName="c:\\test.txt";
public static void main(String args[]){
try{
File file=new File(fileName);
if(file.canRead()){
FileInputStream inStream=new FileInputStream(file);
InputStreamReader reader=new InputStreamReader(inStream,
charEncoding);
JsonParser parser=new JsonParser();
JsonElement jsonA=parser.parse(new BufferedReader(reader));
System.out.println(jsonA.isJsonArray());
System.out.println(jsonA.toString());
}
}catch(IOException e){
e.printStackTrace();
}
}

}

the jar from json.org dun work too.

so is there any json parser that can parse UTF-8 json text (japanese
and chinese character in particular)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate