Skip to content

Instantly share code, notes, and snippets.

@osheroff
Created June 27, 2012 18:48
Show Gist options
  • Save osheroff/3005968 to your computer and use it in GitHub Desktop.
Save osheroff/3005968 to your computer and use it in GitHub Desktop.
syck utf-8 compat
# 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