PC Review


Reply
Thread Tools Rate Thread

Converting from the DOS OEM to Windows ANSI character sets

 
 
Casteele/ShadowLord
Guest
Posts: n/a
 
      9th Jan 2008
Hi,

I'm creating a database which has a VBA module to read a number of records
in from a old DOS based file (which uses the old DOS OEM characterset), and
fill an Access 2000 table with the data. However, Windows (and Access 2000)
use the ANSI character set. The StrConv function only seems to convert from
ANSI <-> Unicode, and a few other specialized charsets (Far East). But they
do not appear to handle OEM at all.

How can I convert (using only Access 2000/VBA; I cannot rely on 3-rd party
or external utilities) this data from DOS OEM to ANSI? (So far, the only
thing I can come up with is to create a table that has the OEM char in one
column, and the ANSI char in the other, then write code which loops through
the text replacing one with the other.. But I'm hoping for a better solution!)

Thanks,
C.

 
Reply With Quote
 
 
 
 
GeoffG
Guest
Posts: n/a
 
      11th Jan 2008
I flagged your post two days ago to see if anyone with expertise in this
area would answer. If you still need comments, I have a few - and an
interest in how you actually solve the problem.

Is your DOS OEM something like Compaq DOS Version 3.31 or DR DOS? Do you
know which character numbers represent which characters?

It's odd that the OEM didn't use ASCII, Extended ASCII, ANSI, Code Page 437
(aka MSDOS Latin US), or some other code page. There's also DBCS and
Unicode.

Visual Basic always uses Unicode, whichever version of Windows it's running
on (i.e. whichever character set is native to your version of Windows).

I'm not sure there's a better solution than something like the one you
suggest. I'd be inclined to use VBA to read the text file into a character
array, loop through the array making character substitutions where
necessary, writing back to a text file, and using the normal import wizard.

Are you happy that the text files are good (i.e. not corrupted)? Does each
character number stored in the text file reliably represent a given
character?

Regards
Geoff



"Casteele/ShadowLord" <(E-Mail Removed)> wrote
in message news:F1EE7A2A-FD8E-4201-963B-(E-Mail Removed)...
> Hi,
>
> I'm creating a database which has a VBA module to read a number of records
> in from a old DOS based file (which uses the old DOS OEM characterset),
> and
> fill an Access 2000 table with the data. However, Windows (and Access
> 2000)
> use the ANSI character set. The StrConv function only seems to convert
> from
> ANSI <-> Unicode, and a few other specialized charsets (Far East). But
> they
> do not appear to handle OEM at all.
>
> How can I convert (using only Access 2000/VBA; I cannot rely on 3-rd party
> or external utilities) this data from DOS OEM to ANSI? (So far, the only
> thing I can come up with is to create a table that has the OEM char in one
> column, and the ANSI char in the other, then write code which loops
> through
> the text replacing one with the other.. But I'm hoping for a better
> solution!)
>
> Thanks,
> C.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to use ansi character codes yawnmoth Windows XP Help 2 15th Nov 2007 06:08 AM
ASCII / ANSI Character sets in Vista Vista Advocate - Now Windows Vista General Discussion 0 5th Apr 2007 11:44 PM
ANSI character code question Bruce Acciavatti Microsoft Access 1 4th Nov 2005 06:18 PM
Change character set OEM to ANSI =?Utf-8?B?Y2hyaXM=?= Microsoft Windows 2000 Setup 0 16th Mar 2005 04:23 PM
Unicode - ansi character conversion =?Utf-8?B?TmFkYXY=?= Microsoft C# .NET 2 30th Dec 2004 02:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:35 AM.