diff --git a/lib/ffi_yajl/encoder.rb b/lib/ffi_yajl/encoder.rb
index <HASH>..<HASH> 100644
--- a/lib/ffi_yajl/encoder.rb
+++ b/lib/ffi_yajl/encoder.rb
@@ -47,7 +47,7 @@ module FFI_Yajl
         if str.respond_to?(:scrub)
           str.scrub!
         else
-          str.encode!("UTF-8", undef: :replace, invalid: :replace)
+          str.encode!("UTF-16le", undef: :replace, invalid: :replace).encode!('UTF-8')
         end
       end
       str
@@ -68,7 +68,7 @@ module FFI_Yajl
       if token.respond_to?(:scrub)
         token.scrub!
       else
-        token.encode("utf-8", undef: :replace, invalid: :replace)
+        token.encode!("UTF-16le", undef: :replace, invalid: :replace).encode!('UTF-8')
       end
       case status
       when 1 # yajl_gen_keys_must_be_strings
fixes for <I> and <I>

this is kind of shitty code, but once <I> and <I> are dropped and we
can use #scrub then all the shitty code can go away...