Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 5482efc

Browse files
[[ Bug 14203 ]] Adapt the required size when calling MCU_multibytetounicode
1 parent 2902831 commit 5482efc

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

docs/notes/bugfix-14203.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# uniencode / decode broken

engine/src/dskw32.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4081,8 +4081,12 @@ struct MCWindowsDesktop: public MCSystemInterface, public MCWindowsSystemService
40814081
dsize = WideCharToMultiByte( codepage, 0, (LPCWSTR)t_string_ptr, p_string_length >> 1,
40824082
(LPSTR)t_buffer_ptr, p_buffer_length, NULL, NULL);
40834083
else
4084+
{
40844085
dsize = MultiByteToWideChar( codepage, 0, (LPCSTR)t_string_ptr, p_string_length, (LPWSTR)t_buffer_ptr,
40854086
p_buffer_length >> 1);
4087+
// SN-2014-12-15: [[ Bug 14203 ]] The required size must be adapted as it was beforehand
4088+
dsize <<= 1;
4089+
}
40864090

40874091
return dsize;
40884092
}

0 commit comments

Comments
 (0)