Re: [PATCH 2/3] riched20: Added support for UTF8 BOM stream. (Try 2)
Qian Hong <fracting(a)gmail.com> writes:
@@ -304,8 +307,19 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea
if (!(dwFormat & SF_UNICODE)) { - /* FIXME? this is doomed to fail on true MBCS like UTF-8, luckily they're unlikely to be used as CP_ACP */ - nWideChars = MultiByteToWideChar(CP_ACP, 0, stream->buffer, stream->dwSize, wszText, STREAMIN_BUFFER_SIZE); + if (!is_read) + { + is_read = TRUE; + if (stream->dwSize >= 3 && !memcmp(stream->buffer, bom_utf8, 3)) + { + cp = CP_UTF8; + stream->dwSize -= 3; + memmove(stream->buffer, stream->buffer + 3, stream->dwSize);
There's no reason to move the data. -- Alexandre Julliard julliard(a)winehq.org
On Fri, Aug 17, 2012 at 1:37 AM, Alexandre Julliard <julliard(a)winehq.org> wrote:
There's no reason to move the data.
Thanks for review! Will provide a better version soon. -- Regards, Qian Hong - Sent from Ubuntu http://www.ubuntu.com/
participants (2)
-
Alexandre Julliard -
Qian Hong