Re: More bugs in exw.exe

new topic     » goto parent     » topic index » view thread      » older message » newer message

CChris wrote:

> Juergen Luethje wrote:
> 
>> CChris wrote:

[snipped old text]

>>> Looks like I'm going to import the capitalisation
>>> table using function AX=#6504 to a sequence and transcode accented chars
>>> using
>>> that. Unless AX=#6522 is considered a decent, bug-free substitute - the
>>> character
>>> tables may differ subtly.
>> 
>> It seems to me that the official DOS functions to capitalize a string are
>> INT 21, AX=#6521 and AX=#6522. Here is an example:
>> <http://www.uv.tietgen.dk/Staff/Mlha/PC/Prog/asm/int/21/6521.htm>
>> 
> 
> I have played with them last evening, and decided not to use them either.
> Capitalisation
> of accented characters is not done or at least not always done - for instance,
> ü and Ü are not recognised as differing in case only.

It looks as if I've found the reason for this. In my tests,
INT 21 AX=#6521 properly capitalizes all lowercase German special
characters in _ASCII_ code. But when I just open an editor on Windows
and type some text, the text normally is in _ANSI_ code ...

      |      in       | output of INT 21 AX=#6521 (on Win XP)
------+---------------+--------------------------------------
      |     "äöü"     |
ASCII | {#84,#94,#81} |  {#8E,#99,#9A} = "ÄÖÜ"  -->  correct
ANSI  | {#E4,#F6,#FC} |  {#E5,#F6,#FC} = "åöü"  -->  wrong

And the problem is that a program hardly knows, whether a file that it
reads is coded in ASCII or in ANSI.

> The only thing that I got working is the one I mentioned, ie working directly
> with the filename capitalisation table a pointer to which is returned by
> function
> #6504. I'm currently streamlining the code, since conditional jumps are
> usually
> bad for performance, but basically that fixed the bug.

If this is reliable, then it's fine. Did you test it with special
characters in ASCII code and ANSI code?

> Under Windows, there's a CharUpperA() API that does the job straight and
> hardly
> ever fails, so using it is certainly the safest way to go.

I always use CharUpperBuffA(), but I really hope the results are the
same as with CharUpperA(). smile

      |      in       | output of CharUpperBuffA() (on Win XP)
------+---------------+---------------------------------------
      |     "äöü"     |
ASCII | {#84,#94,#81} |  {#84,#94,#81} = "äöü"  -->  wrong
ANSI  | {#E4,#F6,#FC} |  {#C4,#D6,#DC} = "ÄÖÜ"  -->  correct

So yes, it hardly ever fails -- as long as the special characters are
coded in ANSI. >:->

Regards,
   Juergen

-- 
Computers help to solve problems,
which wouldn't exist without computers.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu