Created
June 27, 2012 18:48
-
-
Save osheroff/3005968 to your computer and use it in GitHub Desktop.
syck utf-8 compat
This file contains hidden or 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
# force UTF-8 on all strings back from YAML. | |
class << YAML::DefaultResolver | |
def node_import_with_utf8(node) | |
val = node_import_without_utf8(node) | |
val.force_encoding("UTF-8") if val.respond_to?(:force_encoding) | |
val | |
end | |
alias_method_chain :node_import, :utf8 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment