User forums > Using Code::Blocks

Unicode format

(1/1)

zhuxuan:
I am a student in Taiwan. I use code::blocks with mingw before. Recently, I try to use code::blocks with Visual Studio 2005 Express Edition, and there are some Chinese in my code. I set the file encoding to UTF-8, but when I compiling, I got the warning ...

main.cpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss

I try to use other encoding, for example, Unicode default. It does solve this problem, but I cannot use other editor to edit the source file.

Anyone has the same problem? Any ideas ?
Thanks all.

rjmyst3:
Microsoft's compiler requires a byte-order-mark to recognize it as a UTF-8 file. In Code::Blocks, go to Edit->File Encoding and select "Save byte-order-mark (BOM)" then save the file and compile.

zhuxuan:
Thank you very very very very much !!!!
I got it !!

Navigation

[0] Message Index

Go to full version