スポンサーリンク

VC++コンパイラがサポートするソースコードのエンコード方式

いつもの通りここ経由で、
Sorting It All Out : Your VC++ files don’t support Unicode identifers? Drop a BOM on them!

ここを参照しました。
Unicode Support in the Compiler and Linker

Source code files

Unicode characters are now supported in identifiers, macros, string and character literals, and in comments. Universal character names are also now supported.

Unicode can be input into a source code file in the following encodings:

  • UTF-16 little endian with or without byte order mark (BOM)

  • UTF-16 big endian with or without BOM

  • UTF-8 with BOM

うーん。ASCIIファイルと区別がつかねーからUTF-8にはBOMをつけろゴラァと言うことのようなんですが、一方OSS系ではUTF-8なテキストファイルにBOMをつけるとまずい物もあったりしますので、やっかいですね。

現状はソースコードに関してはBOM付きUTF-8として保存しておくしかなさそうです。

私は現状においてOEMコードでソースコード保存する正当な理由はないと思っています。

コメント

タイトルとURLをコピーしました