diff options
author | Zhiming Wang <zmwangx@gmail.com> | 2015-05-04 15:03:55 -0700 |
---|---|---|
committer | Zhiming Wang <zmwangx@gmail.com> | 2015-05-04 15:03:55 -0700 |
commit | ee374553f2ba385157eec9a816cf9b023fbfb18a (patch) | |
tree | 2972641f3de868f727f4210f97d461b4f4e1a2b5 /source/blog/2015-01-01-os-x-system-ruby-encoding-annoyance.md | |
parent | 301679861a2440a10c9eac746cec86459f445ef9 (diff) | |
download | my_new_personal_website-ee374553f2ba385157eec9a816cf9b023fbfb18a.tar.xz my_new_personal_website-ee374553f2ba385157eec9a816cf9b023fbfb18a.zip |
process post metadata
Diffstat (limited to 'source/blog/2015-01-01-os-x-system-ruby-encoding-annoyance.md')
-rw-r--r-- | source/blog/2015-01-01-os-x-system-ruby-encoding-annoyance.md | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blog/2015-01-01-os-x-system-ruby-encoding-annoyance.md b/source/blog/2015-01-01-os-x-system-ruby-encoding-annoyance.md index 2bef694d..d27b0507 100644 --- a/source/blog/2015-01-01-os-x-system-ruby-encoding-annoyance.md +++ b/source/blog/2015-01-01-os-x-system-ruby-encoding-annoyance.md @@ -1,15 +1,13 @@ --- -layout: post title: "OS X system ruby encoding annoyance" date: 2015-01-01 22:49:39 -0800 -comments: true -categories: +date-display: January 1, 2015 --- I've been using RVM (with fairly up-to-date Rubies) and pry since my day one with Ruby (well, almost), so it actually surprises me today when I found out by chance how poorly the system Ruby behaves when it comes to encoding. The major annoyance with the current system Ruby (2.0.0p481) is that it can't convert `UTF8-MAC` to `UTF-8` (namely, NFD to NFC, as far as I can tell), at least not with Korean characters. Consider the following script: -```ruby utf8-mac.rb +```ruby # coding: utf-8 require 'hex_string' str = "에이핑크" |