xsharp.eu • Char Set
Page 1 of 1

Char Set

Posted: Wed May 31, 2017 11:41 am
by Juraj
I have a DBF file created in VO 2.6. When opening with OleDB connection in X# app, some characters will not be displayed correctly. In VO application, characters are displayed correctly on the same PC

Char Set

Posted: Wed May 31, 2017 11:57 am
by robert
Jura,

Which OLEDB provider are you using ?
Can you mail me an example file ?
Robert

Char Set

Posted: Wed May 31, 2017 12:09 pm
by Juraj
I using this connection string:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+DBFDIR+";Extended Properties=dBASE IV;User ID=;Password=;"

Char Set

Posted: Wed May 31, 2017 1:05 pm
by robert
Juraj,

Mosty likely the Jet Dbase IV driver is not properly recognizing the Ansi/OEM bit in the DBF file or not recognizing the codepage.
I need to see your file to give an answer to that and to help you to make this work.

Robert

Char Set

Posted: Wed May 31, 2017 1:31 pm
by Juraj
I sent a DBF file on the mail robert@xsharp.eu

Char Set

Posted: Wed May 31, 2017 3:22 pm
by robert
Juarj,

Your database is created on a Central/Eastern European windows computer. This is visible when you look at byte 29 in the file. It has the value 0xC8.
That corresponds to the Codepage 1250.

https://msdn.microsoft.com/en-us/library/aa975345(v=vs.71).aspx

You need to tell the Jet driver to use a locale that matches that codepage too by adding the string "Locale Identifier=nnnn;" to your connection string.

You need to select a locale that has codepage 1250.

See http://www.science.co.il/language/Locale-codes.php

For example 1045 (Polish), 1029 (Czech) or 1051 (Slovak).

That should fix the problem.

Robert

Char Set

Posted: Thu Jun 01, 2017 6:30 am
by Juraj
Rober,

I used more versions connstring:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+DBFFullNaz+";Extended Properties=dBASE IV;User ID=;Password=;Locale Identifier=1250"
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+DBFFullNaz+";Extended Properties=dBASE IV;User ID=;Password=;Locale Identifier=1252"
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+DBFFullNaz+";Extended Properties=dBASE IV;User ID=;Password=;Locale Identifier=1051"
But the problem has not fixed.

Juraj

Char Set

Posted: Thu Jun 01, 2017 6:34 am
by robert
Juraj,

You need to give me more information.
Do you see any difference when you set the locale ?
And as far as I know you do not give the locale the codepage but the country id. So not 1250 or 1252 but 1051.

How are you checking the text? With the console window or on a UI window. Is that a VO GUI window (Ansi) or a Winforms window (Unicode).

And what is the active Ansi codepage on your computer ?

Can you create a small example of what you are doing.


Robert