delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/04/09/02:00:40

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Trace-PostClient-IP: 68.147.131.211
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT Invalid>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help with codepages/character sets
Organization: Systematic Software
Message-ID: <88bc70h4isbs1kfmb6rf09mipe01b4juv3@4ax.com>
References: <20040408124015 DOT A19109 AT webster DOT tsc DOT com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Lines: 58
Date: Fri, 09 Apr 2004 05:53:27 GMT
NNTP-Posting-Host: 24.71.223.147
X-Complaints-To: abuse AT shaw DOT ca
X-Trace: pd7tw3no 1081490007 24.71.223.147 (Thu, 08 Apr 2004 23:53:27 MDT)
NNTP-Posting-Date: Thu, 08 Apr 2004 23:53:27 MDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Thu, 8 Apr 2004 12:40:15 -0500 in comp.os.msdos.djgpp, Bob
Poortinga <djgpp DOT 20 DOT bobp AT spamgourmet DOT com> wrote:

>Is there any method available to use Codepage 1252 (Windows-1252) or
>the ISO-8859-1 charset in a program compiled and linked with DJGPP?

Load MS DOS codepage 850 for Latin-1/ISO-8859-1 support in CONFIG.SYS,
or the equivalent file for your OS version: 
DEVICE=C:\dir\DISPLAY.SYS con=(ega,,1)
COUNTRY=nnn,850,C:\dir\COUNTRY.SYS
where	nnn	is your country code (001==USA)
	dir	is the directory containing the DOS country.sys driver

and in AUTOEXEC.BAT, or the equivalent file for your OS version: 

MODE con CODEPAGE PREPARE=((437 850) C:\dir\EGA.CPI)
MODE con CODEPAGE SELECT=850
NLSFUNC C:\dir\COUNTRY.SYS
KEYB US,,C:\dir\KEYBOARD.SYS

If you're running a version of MS Windows, you may also want to check
the value of the registry key: 
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\Codepage\OEMCP
and make sure the value is 850. 

>The programs I'm working on decode a filename from a data file (generated
>with CP1252) and open a file with the decoded filename as part of
>the filename passed to fopen().  fopen() at this point is using CP437
>to open the file which creates a mismatch in the filename.  The problem
>child in this scenario is the slashed zero (CP1252 = 0xD8) which does
>not exist in CP437.

In CP437 0xD8 will appear like a not equals glyph in box drawing
characters (double horizontal single vertical intersection): is that
what you are seeing?  
What symptoms are you seeing that make you believe the codepage
affects the characters stored for the filename? 
Have you checked the characters stored in the directory entry with a
disk editor or debug? 

>I've google'd myself silly trying to find a solution.  I've tried the
>locale library which doesn't seem to support it.  Is there a reasonable
>way to do this without resorting to writing my own translator?

For more info see article:
http://www.delorie.com/djgpp/doc/eli-m17n99.html#I18N

>BTW, the reason I'm using DJGPP is because of execution speed.  The
>version of my decoder compiled with DJGPP gcc 3.3 runs over 2 times
>faster than the version compiled with M$ C++ 6.0 and runs 10%-20% faster
>than Cygwin.  However, neither the M$ version nor the Cygwin version suffer
>from this codepage problem.

-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

Brian DOT Inglis AT CSi DOT com 	(Brian dot Inglis at SystematicSw dot ab dot ca)
    fake address		use address above to reply

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019