Opened on May 10, 2016 at 7:50:30 AM
Closed on Feb 8, 2018 at 4:46:13 PM
Last modified on Feb 13, 2018 at 1:52:29 PM
#3230 closed Bug (Completed)
_WideCharToMultiByte fails with double-byte codepages
| Reported by: | jchd18 | Owned by: | Jon |
|---|---|---|---|
| Milestone: | 3.3.14.3 | Component: | Standard UDFs |
| Version: | 3.3.14.0 | Severity: | None |
| Keywords: | Cc: |
Description (last modified by )
The structure in _WideCharToMultiByte (WinAPI.AU3) needs to use the byte type instead of char, else the result is wrong when the user is requesting output in double-byte codepage (Korean, Japanese, and several other Asian codepages) AND the current default system codepage is also double-byte.
Follows from thread https://www.autoitscript.com/forum/topic/182255-unicode-stringtobinary-for-unsupported-language/?page=1 where both working and failing examples are available.
Attachments (0)
Change History (8)
comment:1 by , on May 10, 2016 at 7:52:56 AM
| Description: | modified (diff) |
|---|
comment:4 by , on May 20, 2016 at 1:34:21 PM
| Milestone: | → 3.3.15.1 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Fixed by revision [11700] in version: 3.3.15.1
comment:5 by , on Feb 8, 2018 at 12:53:41 PM
| Resolution: | Fixed |
|---|---|
| Status: | closed → reopened |
I reopen this ticket as the solution is now to use and extra parameter whichwill use the byte type leaving char for other cases
comment:7 by , on Feb 8, 2018 at 4:46:13 PM
| Milestone: | → 3.3.15.1 |
|---|---|
| Owner: | changed from to |
| Resolution: | → Completed |
| Status: | reopened → closed |
Added by revision [11954] in version: 3.3.15.1
comment:8 by , on Feb 13, 2018 at 1:52:29 PM
| Milestone: | 3.3.15.1 → 3.3.14.3 |
|---|---|
| Owner: | changed from to |
Added by revision [11957] in version: 3.3.14.3

So this line:
Local $tMultiByte = DllStructCreate("char[" & $aResult[0] & "]")should read:
Local $tMultiByte = DllStructCreate("byte[" & $aResult[0] & "]")M23