https://bugs.winehq.org/show_bug.cgi?id=38910
Bug ID: 38910 Summary: Notepad should detect if there are characters in the file which cannot be represented in the target codepage Product: Wine Version: 1.1.19 Hardware: x86 OS: Linux Status: NEW Keywords: download, source Severity: minor Priority: P2 Component: programs Assignee: wine-bugs@winehq.org Reporter: austinenglish@gmail.com Distribution: ---
See bug 18191 for the original discussion.
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 ]
We'd want to use MultiByteToWideChar, as IsTextUnicode doesn't support utf-8.