LoginSignup
19
19

More than 5 years have passed since last update.

ここ(Windows)に「☭」という名前のファイルがあるじゃろ?

Posted at

中身も「☭」(UTF8)のはずなんじゃが、そのまま type すると

<C:\Opt\gosrc\nyagos>
$ type ☭
笘ュ

だめ。そりゃ、chcp 932 のままだからの。では、nkf32 を使ってはどうか。

<C:\Opt\gosrc\nyagos>
$ nkf32 < ☭
笘ュ

うん、ShiftJIS で表現できない文字だからのー。

だが、先日 go で作った ANSI エスケープシーケンスをカットするだけの cat もどきを通すと、あら不思議

<C:\Opt\gosrc\nyagos>
$ ansistrip.exe < ☭
☭

ちゃんと表示されるんじゃ。goの標準ライブラリがUTF8をUTF16に変換してAPIに渡してくれるんじゃ。これだけでも go を使う価値ありじゃろ?

19
19
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
19