Skip to content

Instantly share code, notes, and snippets.

@kachick
Forked from tune/disp_ucs_thai.rb
Created December 5, 2012 11:54
Show Gist options
  • Save kachick/4214980 to your computer and use it in GitHub Desktop.
Save kachick/4214980 to your computer and use it in GitHub Desktop.
Rubyを使ってタイ語の表示文字単位で文字列を区切る ref: http://qiita.com/items/55c4347df63472346ac8
# coding: utf-8
# http://qiita.com/items/55c4347df63472346ac8
thai_str = "พี่ชาย"
thai_chars = thai_str.scan(/.(?:[\u0E31]|[\u0E33-\u0E3A]|[\u0E47-\u0E4E])*/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment