diff options
author | Florian Frank <flori@ping.de> | 2012-05-09 23:57:51 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2012-05-09 23:57:51 +0200 |
commit | 23ef680a3d43ed02d343611150d638d542c0190b (patch) | |
tree | d06d5d402059bd05ec7e76cd479e9ba4856941e5 /java | |
parent | 6d9a1d8caaf70b6a6c6878b66cff661f32c8355a (diff) | |
download | json-23ef680a3d43ed02d343611150d638d542c0190b.tar.gz |
force jruby encoding after generation
Diffstat (limited to 'java')
-rw-r--r-- | java/src/json/ext/GeneratorState.java | 4 |
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; } |