Author Topic: Unicode format  (Read 8542 times)

Offline zhuxuan

  • Single posting newcomer
  • *
  • Posts: 8
Unicode format
« on: January 08, 2007, 04:21:51 pm »
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.

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: Unicode format
« Reply #1 on: January 08, 2007, 06:46:47 pm »
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.

Offline zhuxuan

  • Single posting newcomer
  • *
  • Posts: 8
Re: Unicode format
« Reply #2 on: January 10, 2007, 03:22:38 am »
Thank you very very very very much !!!!
I got it !!