Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1365)

Unified Diff: google-http-client/src/main/java/com/google/api/client/testing/json/AbstractJsonParserTest.java

Issue 5333046: [Issue 28] JsonFactory#toString() depends on default charset (Closed) Base URL: https://google-http-java-client.googlecode.com/hg/
Patch Set: minor nit Created 12 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: google-http-client/src/main/java/com/google/api/client/testing/json/AbstractJsonParserTest.java
===================================================================
--- a/google-http-client/src/main/java/com/google/api/client/testing/json/AbstractJsonParserTest.java
+++ b/google-http-client/src/main/java/com/google/api/client/testing/json/AbstractJsonParserTest.java
@@ -406,6 +406,16 @@
assertEquals(NUMBER_TYPES, factory.toString(result));
}
+ private static final String UTF8_VALUE = "123\u05D9\u05e0\u05D9\u05D1";
+ private static final String UTF8_JSON = "{\"value\":\"" + UTF8_VALUE + "\"}";
+
+ public void testToFromString_UTF8() throws IOException {
+ JsonFactory factory = newFactory();
+ GenericJson result = factory.fromString(UTF8_JSON, GenericJson.class);
+ assertEquals(UTF8_VALUE, result.get("value"));
+ assertEquals(UTF8_JSON, factory.toString(result));
+ }
+
public static class AnyType {
@Key
public Object arr;

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b