#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 , 10 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 10 years ago
comment:4 by , 10 years ago
| 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 , 8 years ago
| 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 , 8 years ago
| 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 , 8 years ago
| 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