Bug 40441 - UTF-8 signature support
Summary: UTF-8 signature support
Status: RESOLVED DUPLICATE of bug 33415
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.2.3
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-14 22:56 UTC by Edward Liu
Modified: 2009-06-14 23:03 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
the binary UTF-8 signature (11 bytes, text/plain)
2009-06-14 22:58 UTC, Edward Liu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edward Liu 2009-06-14 22:56:29 UTC
UTF-8 signature is the UTF-8 character 'ef bb bf' at the start of a .cpp .c file. When you edit a UTF-8 file with notepad, it also put the signature at the start of the file.
Microsoft Visual Studio 2008 C++ compiler reads this to detect the encoding of a text file. Without this signature, a UTF-8 const string literal with chinese characters is not read correctly in Visual C++.

Please skip the  'EF BB BF' at the start of a .cpp .c file. Currently this signature causes compilation errors on GCC. Add this feature will easy the porting of WIN32 software to GCC.
Comment 1 Edward Liu 2009-06-14 22:58:46 UTC
Created attachment 17997 [details]
the binary UTF-8 signature
Comment 2 Joseph S. Myers 2009-06-14 23:03:33 UTC
This was fixed for 4.4.


*** This bug has been marked as a duplicate of 33415 ***