Board index » delphi » HELP: Foreign Carac. in BPW 7.0

HELP: Foreign Carac. in BPW 7.0

I upgraded from TP 5.5 for DOS to BP 7.0 and I have the following =

problem:
When I read an old source file in BPW all foreing caracters with accents =

(=E9,=EA,=E7, etc) do not show up or are replaced with other caracters =

instead.  The same files in BP 7.0 or TP 7.0 (for DOS) are OK.  It is =

surely related to windows or a bug in BPW.  Can somebody help??
This happen in Win 3.11 or Win 95!
Any advice welcome.
Thanks

 

Re:HELP: Foreign Carac. in BPW 7.0


Quote
In article <3222449D.3...@itr.qc.ca> Christian Lambert wrote:
>I upgraded from TP 5.5 for DOS to BP 7.0 and I have the following
>problem:
>When I read an old source file in BPW all foreing caracters withaccents
>(,,?, etc) do not show up or are replaced with other caracters
>instead.  The same files in BP 7.0 or TP 7.0 (for DOS) are OK.  It is
>surely related to windows or a bug in BPW.  Can somebody help??
>This happen in Win 3.11 or Win 95!
>Any advice welcome.
>Thanks

DOS defaults to using code page 437 and I believe Windows defaults to
code page 850, which is often referred to as the multilingual or the
Latin character set.  Regardless, the sets are not the same.

You need to use the kernel functions OemToAnsi or OemToAnsiBuff to
translate a string from the OEM-defined character set into the
Windows character set.  If you want to write to a DOS file you can
can use the complimentary functions AnsiToOem or AnsiToOemBuff to
translate a string from the Windows character set into the default
DOS character set.

Naturally you can have your window select an OEM font, then the
correct characters will be displayed w/o your having to convert
each line.  Since the OEM character set is fixed pitch, it might
prove the best choice if the text contains line draw characters or
other alignments that depend upon the fixed pitch character set used
by DOS.

    ...red

Re:HELP: Foreign Carac. in BPW 7.0


Quote
In article <3222449D.3...@itr.qc.ca>, Christian Lambert <Christian_Lamb...@itr.qc.ca> writes:
>I upgraded from TP 5.5 for DOS to BP 7.0 and I have the following =

>problem:
>When I read an old source file in BPW all foreing caracters with accents =

>(=E9,=EA,=E7, etc) do not show up or are replaced with other caracters =

>instead.  The same files in BP 7.0 or TP 7.0 (for DOS) are OK.  It is =

>surely related to windows or a bug in BPW.  Can somebody help??
>This happen in Win 3.11 or Win 95!
>Any advice welcome.
>Thanks

Sounds like you're stumbling over the differences between DOS' and
Windows' standard character sets, which are far from identical for the
trans-128 byte codes.  DOS uses a character set that is properly
referred to as PC-8 (though is often simply called "ASCII"), whereas
Windows (up through 3.1x; NT and Win95 also offer UniCode, which is a
whole other ballgame) uses the "ANSI" character set.  Both sets are
identical up through byte code 127, but after that diverge radically.  
Both include a large number of accented Latin letters, but the
characters don't reside at the same byte locations (e.g. lowercase
accent ague e is at byte code 130 in PC-8, but is at 233 in ANSI), and
there are many characters unique to each set.  

Depending on the context in which you're using these characters, your
best solution will vary; you might want to change the display font to
one that supports PC-8 rather than ANSI (e.g. the Windows "Terminal"
font), you might want to convert your files/strings completely to ANSI
encoding, or you might want to make use of the Windows API calls for
converting back and forth: AnsiToOem() and OemToAnsi().

If this doesn't help, email and give me a few more details of what
you're doing and I'll try to be more specific about a solution.

Regards,

-* Stephen *-
Stephen Posey                  --           University of New Orleans
Email: S...@uno.edu             --        WWW: http://www.uno.edu/~slp
---------------------------------------------------------------------
"But is all this true?" said Brutha.
Didactylos shrugged, "Could be.  Could be.  We are here and it is now.
The way I see it is, after that everything tends toward guesswork."
                                    -- Terry Pratchett: _Small Gods_

Re:HELP: Foreign Carac. in BPW 7.0


Quote
Christian Lambert wrote:

> I upgraded from TP 5.5 for DOS to BP 7.0 and I have the following
> problem:
> When I read an old source file in BPW all foreing caracters with accents
> (,,?, etc) do not show up or are replaced with other caracters
> instead.  The same files in BP 7.0 or TP 7.0 (for DOS) are OK.  It is
> surely related to windows or a bug in BPW.  Can somebody help??
> This happen in Win 3.11 or Win 95!
> Any advice welcome.
> Thanks

This has to do with Windows' mapping of characters. The alphabet outside
the 127 ASCII characters is not standardised and under DOS you would
have used the IBM character set.  Under Windows another mapping takes
place and it also depends on the font you're using.

I ususally use the character map application (Accessories) and choose
the character I need in the font that is used on screen for the output.
(I use Helv8 which is mapped to MSSansSerif) I paste the desired
character into the source code where it more often than not look at all
like the charcter I want.  However, on screen, once the program runs,
everything is fine.  I wished there was a better way!

I suggest you find out which characters you need and how you make them
them look right in the final output under Windows.  Then write a quick
mapping program to change all your DOS source code to use the correct
ones.

Matthias

Re:HELP: Foreign Carac. in BPW 7.0


There's a function in the windows API that's calles OemToAnsi(). Take a
look at that.

Anco.

Other Threads