summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2012-05-09 23:57:51 +0200
committerFlorian Frank <flori@ping.de>2012-05-09 23:57:51 +0200
commit23ef680a3d43ed02d343611150d638d542c0190b (patch)
treed06d5d402059bd05ec7e76cd479e9ba4856941e5 /java
parent6d9a1d8caaf70b6a6c6878b66cff661f32c8355a (diff)
downloadjson-23ef680a3d43ed02d343611150d638d542c0190b.tar.gz
force jruby encoding after generation
Diffstat (limited to 'java')
-rw-r--r--java/src/json/ext/GeneratorState.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/java/src/json/ext/GeneratorState.java b/java/src/json/ext/GeneratorState.java
index 65ee984..0584959 100644
--- a/java/src/json/ext/GeneratorState.java
+++ b/java/src/json/ext/GeneratorState.java
@@ -212,6 +212,10 @@ public class GeneratorState extends RubyObject {
throw Utils.newException(context, Utils.M_GENERATOR_ERROR,
"only generation of JSON objects or arrays allowed");
}
+ RuntimeInfo info = RuntimeInfo.forRuntime(context.getRuntime());
+ if (info.encodingsSupported()) {
+ result.force_encoding(context, info.utf8.get());
+ }
return result;
}