by jhawthorn · 14y ago · 0 comments
Fullwidth conversion code in ruby:
"string".tr(' !-~', "\u3000" + (0xFF01...0xFF5f).to_a.pack('U*')) Nam
Nam
(By the way, they seem to break tab-indentation for pre formatted text in the markdown.)Since they are only used in CJK languages the majority of programmers are unaware of them. The seperate code points between half-width and full-width mean that you need a decent unicode library. Otherwise a user could spoof another user.
One cool feature is it lets you write monospaced even if you do not control the font. Since there are full-width codepoints for most programming symbols.