[Bug 18191] Notepad should detect text type and prompt to change saved file encoding automatically

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Apr 26 07:47:58 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=18191


Alexander Scott-Johns <alexander.scott.johns+winebug at googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alexander.scott.johns+winebu
                   |                            |g at googlemail.com




--- Comment #8 from Alexander Scott-Johns <alexander.scott.johns+winebug at googlemail.com>  2009-04-26 07:47:58 ---
(In reply to comment #7)

> In my past testing, it always saves as ISO-8859 (English locale), but if
> unicode only characters are used, I'm warned that data loss may occur and that
> I should save as UTF-8.

Windows XP Notepad remembers the encoding of the file when it is opened, and
uses the same encoding when saving (although UTF16-BE will become UTF16-LE). If
the file is new, the default encoding is the active ANSI codepage. When saving,
if there are characters in the file which cannot be represented in the target
codepage, Notepad will put up a warning:

 == Notepad ==

 <filename>
  This file contains characters in Unicode format which will be lost if
 you save this file as an ANSI encoded text file. To keep the Unicode
 information, click Cancel below and then select one of the Unicode
 options from the Encoding drop down list. Continue?
   [ OK ]   [ Cancel ]

IsTextUnicode can only detect UTF16-LE and UTF16-BE, and not UTF8, I believe.

Also, WinXP Notepad inserts a byte-order mark when saving as UTF8 (even when
there wasn't one before). This is the three bytes { 0xEF, 0xBB, 0xBF }.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list