| UTF-8 | EF BB BF |
| UTF-16 Big Endian | FE FF |
| UTF-16 Little Endian | FF FE |
| UTF-32 Big Endian | 00 00 FE FF |
| UTF-32 Little endian | FF FE 00 00 |
import os
def removeUTF8Bom(filename):
f = open(filename)
lines = f.readlines()
f.close()
f = open(filename, "w")
bFoundBom = False
index = 0
for line in lines:
if index == 0 and line[:3] == '\xef\xbb\xbf':
line = line[3:]
print(filename + " : removed bom code")
bFoundBom = True
f.write(line)
index = index + 1
f.close()
if bFoundBom == False:
print("!!!! " + filename + " : cannot find bom code")
if __name__ == "__main__":
removeUTF8Bom("target.c")
int main()
{
wcout.imbue(locale("kor"));
wstring k = L"k한글imjinwook";
wcout << k << endl;
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main()
{
wchar_t a[] = L"hello";
wcout << L"hello" << endl;
return 0;
}