Don't corrupt pasted UTF-16 text in wxOSX

Fix breakage introduced by 587067bc68:
pasting text could mangle some Unicode characters if it was in UTF-16.
The code in that commit converted newlines all right, but it also
converted _any_ occurrence of 0x0d to 0x0a, which wasn't very Unicode
friendly.

Fixed by partially reverting the change and adding a dedicated UTF-16
variant of wxMacConvertNewlines13To10() instead.
This commit is contained in:
Václav Slavík
2017-01-29 13:55:56 +01:00
parent 5520702674
commit 288a301b97
3 changed files with 9 additions and 5 deletions

View File

@@ -34,9 +34,9 @@ void wxMacConvertNewlines13To10( char * data )
}
}
void wxMacConvertNewlines13To10( char * data, size_t len )
void wxMacConvertNewlines13To10( wxChar16 * data )
{
for ( ; len; ++data, --len )
for ( ; *data; ++data )
{
if ( *data == 0x0d )
*data = 0x0a;