Modify

#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 jchd18)

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 jchd18, on May 10, 2016 at 7:52:56 AM

Description: modified (diff)

comment:2 by Melba23, on May 10, 2016 at 8:12:28 AM

So this line:

Local $tMultiByte = DllStructCreate("char[" & $aResult[0] & "]")

should read:

Local $tMultiByte = DllStructCreate("byte[" & $aResult[0] & "]")

M23

comment:3 by jchd18, on May 19, 2016 at 11:53:48 AM

Yes, that fixes the problem.

comment:4 by Melba23, on May 20, 2016 at 1:34:21 PM

Milestone: 3.3.15.1
Owner: set to Melba23
Resolution: Fixed
Status: newclosed

Fixed by revision [11700] in version: 3.3.15.1

comment:5 by Jpm, on Feb 8, 2018 at 12:53:41 PM

Resolution: Fixed
Status: closedreopened

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:6 by TicketCleanup, on Feb 8, 2018 at 1:00:02 PM

Milestone: 3.3.15.1

Automatic ticket cleanup.

comment:7 by Jpm, on Feb 8, 2018 at 4:46:13 PM

Milestone: 3.3.15.1
Owner: changed from Melba23 to Jpm
Resolution: Completed
Status: reopenedclosed

Added by revision [11954] in version: 3.3.15.1

comment:8 by Jon, on Feb 13, 2018 at 1:52:29 PM

Milestone: 3.3.15.13.3.14.3
Owner: changed from Jpm to Jon

Added by revision [11957] in version: 3.3.14.3

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.