-
-
Save anonymous/edacfafeb6d73573d951b28a2551d2c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the original code, but I don't know what 'input' was | |
j = JSON.parse(input) | |
y = j.to_yaml | |
d = YAML.load(y) | |
d.to_json | |
# => Encoding::UndefinedConversionError: "\xE0" from ASCII-8BIT to UTF-8 | |
# I don't know what 'input' was, but 'y' is: | |
y = "\xE0\xA4\xB8".force_encoding('ASCII-8BIT').to_yaml | |
d = YAML.load(y) | |
d.to_json | |
# => Encoding::UndefinedConversionError: "\xE0" from ASCII-8BIT to UTF-8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment