forked from Imagelibrary/binutils-gdb
PR 10165
* winduni.c (wind_MultiByteToWideChar): Do not pass MB_PRECOMPOSED
to MultiByteToWideChar when using the CP_UTF8 or CO_UTF7 types.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2009-06-09 Tom Bramer <tjb@postpro.net>
|
||||||
|
|
||||||
|
PR 10165
|
||||||
|
* winduni.c (wind_MultiByteToWideChar): Do not pass MB_PRECOMPOSED
|
||||||
|
to MultiByteToWideChar when using the CP_UTF8 or CO_UTF7 types.
|
||||||
|
|
||||||
2009-06-04 Alan Modra <amodra@bigpond.net.au>
|
2009-06-04 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* strings.c (main): Delay parsing of decimal digits.
|
* strings.c (main): Delay parsing of decimal digits.
|
||||||
|
|||||||
@@ -661,7 +661,15 @@ wind_MultiByteToWideChar (rc_uint_type cp, const char *mb,
|
|||||||
rc_uint_type ret = 0;
|
rc_uint_type ret = 0;
|
||||||
|
|
||||||
#if defined (_WIN32) || defined (__CYGWIN__)
|
#if defined (_WIN32) || defined (__CYGWIN__)
|
||||||
ret = (rc_uint_type) MultiByteToWideChar (cp, MB_PRECOMPOSED,
|
rc_uint_type conv_flags = MB_PRECOMPOSED;
|
||||||
|
|
||||||
|
/* MB_PRECOMPOSED is not allowed for UTF-7 or UTF-8.
|
||||||
|
MultiByteToWideChar will set the last error to
|
||||||
|
ERROR_INVALID_FLAGS if we do. */
|
||||||
|
if (cp == CP_UTF8 || cp == CP_UTF7)
|
||||||
|
conv_flags = 0;
|
||||||
|
|
||||||
|
ret = (rc_uint_type) MultiByteToWideChar (cp, conv_flags,
|
||||||
mb, -1, u, u_len);
|
mb, -1, u, u_len);
|
||||||
/* Convert to bytes. */
|
/* Convert to bytes. */
|
||||||
ret *= sizeof (unichar);
|
ret *= sizeof (unichar);
|
||||||
|
|||||||
Reference in New Issue
Block a user