Created
February 23, 2009 03:08
-
-
Save ukstudio/68768 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/env ruby | |
# -*- coding: UTF-8 -*- | |
# -*- coding: EUC-JP -*- #=> このmagic commentは無効 | |
p "test".encoding #=> #<Encoding:UT-8> | |
# Magic Commentは1行目、もしくはshebangが1行目の場合は2行目の場合有効。 | |
# Magic Commentが無い場合、US-ASCIIと判断される。 | |
# Magic Commentの形式 | |
# # coding: UTF-8 | |
# # -*- coding: UTF-8 -*- | |
# # vim:set fileencoding=UTF-8: | |
# ちなみに上記3種類以外でも | |
# /coding[:=]\s*[\w.-]+/にマッチする形式が利用可能 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment