Character conversion ASCII to UTF-8?= Old Accesstable to Unicode

L

lexj

First of all a great thanks to all people, no one mentioned, no one
forgotten, that devote their time to give answers to people like me,
having been stuck up with a small problem. There is a Chinese proverb,
" The one that ask's questions seems to be stupid, but the one never
asking questions remain stupid". I belong to that group, that will not
remain stupid...

BACKGROUND
Since many years I have a well working database with some 20 tables.
This database runs in an application "Lexoulla" that contains
basically a greek-english wordlist with some search facilities. It can
be found and downloaded at www.krasaki.com. which site is run by me
just for fun and is strictly non commercial.

OLD BASE AND APP
Made in VB6-DAO 3.51,
Database is an .mdb file, created by Jet 3.0 database engine, build
5903 (Accessversion 7.53 )
local machine language was Swedish at that time
collating order 1033

The database is kept only locally at my machine and some others. No
networking at all.
My local language is Swedish, however inside the actual tables are
only used letters from a-z.

There are also some Swedish letters in one table but for the moment we
can leave that table beside this question.

Most tables keep fields with words in Greek (kind of "Greeklish") and
is correctly presented to the user in the application by a VB6
control" MSFlexgrid" using a special font, the Teknia Greek which make
Greek letters out of what else is just plain latin letters.

If opened up in Access2000, which is possible, the Greek words will be
just "kind of greeklish" presented by latin letters.

THE SITUATION TODAY
I have now migrated to VS2008 and its Visual Basic Express and SQL CE
3.5 (SQL Compact Edition, earlier known as SQL Everywhere) and is
planning to rewrite the old application into dotnet.vb. Forget about
the converter of the whole olde project. Far to many To Do's but that
is not a matter of this posting.

The DataGridView happily presents both greek and latin letters if
they have been written so into a small new "test-base" using different
local input language like this

Dim x As New System.Globalization.CultureInfo("el-GR")
InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(x)

I should now like to convert, not manually by rewriting about 50K of
records, this database into unicode that presents some fields with
greek letters and leave the rest as they are. To emphasize, just
convert the "Greek" fields. Or if there exists some conversation of
the whole old database into SQL CE, including splitting different
fields to different locale languages so why not. But I doubt such a
thing exists and is not a matter of this posting.

FIRST QUESTION
The first question is how to convert. It won´t matter if it will take
some time to process. It is just a one time only operation.

I think it has to be made by opening up one record at a time, convert
actual fields( that could be more than one in a record) and their
values, temporarily store them somewhere in an array , and then just
send the new result away to a new table in an new SQL CE3.5 base. I
know I can handle all of it I think BUT not this conversation of
characters.

I have been looking in this group and others, used generally
"googling" now for some days but I am stuck. I have seen the GetChars
and GetBytes methods. But I can not have them to work. I read in the
values into a datagridview from the old base using

A SECOND QUESTION
Can the String in dotnet.vb complicate things? I mean String as type
is unicode and when testing I have been using the
datagridview.cell.value in a string to laborate....

I should very much appreciate if someone, less stupid than me, can
give me some hints.

Until then, or anyway , A Happy New Year with a lot of Happy Computing
to all of You
lexj
 
L

lexj

Lexj,

Here is probably all information or the links you need.

http://msdn2.microsoft.com/en-us/library/system.text.encoding(VS.80)....

To use it it is something like this
Dim myResult As StreamReader = _
New StreamReader("C:\...\name.txt", New System.Text.Encoding(1251))

(or with the memoryreader if it has to be from mem)

Cor

OK, thanks. I have already been into this encodings and I will give it
more time. So far without success.

This Streamreader thing assumes as I understand it so far that I first
writes everything I want to decode/encode into a file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top