TMPHexEditor can't show national characters (with codes >127) correctly.

Bug #794055 reported by Stanley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Delphi Code Revival
Incomplete
Medium
CCRDude

Bug Description

Original TMPHexEditor and dcrHexEditor can't show Russian letters correctly. Fix: in dcrHexEditor, at line 5857 replace

LWChrOutput := WideChar(TranslateToAnsiChar(Data[LIntDataPos]));

to

TmpChar := TranslateToAnsiChar(Data[LIntDataPos]);
MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, @TmpChar, 1, @LWChrOutput, 1);

Also, it's impossible to enter chars with codes>126 and <32 from keyboard.

Revision history for this message
CCRDude (ccrdude) wrote :

Thanks a lot for this report.

Your suggestions is a workaround, granted, but I think this problem should be accessed in a different way.

TranslateToAnsiChar returns an AnsiChar, but should be updated to return a WideChar instead. Plus, any conversions should take place there (or in its replacement), or by the conversion integrated into newer Delphi's data types.

Could you attach:
1. A simple native codepage russian text sample?
2. The same saved as UTF-8?

A single line with some text should be sufficient, and that way I could test the display myself.

Changed in dcr:
importance: Undecided → Medium
status: New → Incomplete
assignee: nobody → CCRDude (ccrdude)
Revision history for this message
Stanley (stanley-77) wrote : Re: [Bug 794055] Re: TMPHexEditor can't show national characters (with codes >127) correctly.

> Could you attach:
> 1. A simple native codepage russian text sample?
> 2. The same saved as UTF-8?
Yes, of course.

--
С уважением,
 Стэнли mailto:<email address hidden>

Revision history for this message
CCRDude (ccrdude) wrote :

After working on russian localization in another project the past weeks, I went back to this ticket. There's one issue here that's not easy to fix - your workaround works on a russian OS only probably. I'll finally get such a virtual machine these days to be able to test, but I was also looking for ways to improve the output. There already is the Translation property, and it might be nice to have some update to allow a custom codepage (or Delphi CHARSET) to be set to be able to make text readable independent of the systems CP.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.