`
Hooopo
  • 浏览: 335124 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Saving UTF-8 characters to YAML

    博客分类:
  • Ruby
阅读更多
require'yaml'
require'rubygems'
require'ya2yaml'
$KCODE = "u"
hash_with_utf8_value = {:key => "一串UTF-8字符..."}
puts hash_with_utf8_value.to_yaml
puts hash_with_utf8_value.ya2yaml
p(YAML.load hash_with_utf8_value.ya2yaml)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics