I try to get a data from dbf table, but have some problems with encoding. In table, except the numeric values, there are two columns with string data: Name and Comments
Both of them should be in cyrilic encoding and I had problems with both. Tried to open them in Excel and in DBF Commander but in every editor i see that:
Name values looks like - (аа)_+_+__++ е_T з+_+T+++++
And Comments like - гЃЊ”Џ—“‹Џ… ›Џ““… „ЏЌ 256 ‹— 490 Ё-178
After some investigation i find out that values from Comments column can be converted to readable text with such code:
string value = "гЃЊ”Џ—“‹Џ… ›Џ““… „ЏЌ 256 ‹— 490 Ё-178";
var bytes_in = System.Text.Encoding.Default.GetBytes(value);
var bytes_out = System.Text.Encoding.Convert(System.Text.Encoding.GetEncoding(866), System.Text.Encoding.GetEncoding(1251), bytes_in);
var DOS_WIN2 = System.Text.Encoding.GetEncoding(20866).GetString(bytes_out);
Console.WriteLine(DOS_WIN2);
But i can't find any solution for the Name column. I also tried a bunch of automatic encoding convertors but without success. And it looks strange that there are too many '+' symbols in values. In Russian language there are no symbol which is used so often.
So is it possible that particular column in dbf table is somehow broken or encrypted? Is there any way to get data from this column?
I found that Comments column has actually a MIME type with references to .fpt file with real strings. So Name is the only Character column and i can't read it
Define your columns as "Varchar NoCPTrans" so that no ANSI/OEM translations will be performed on the data. Which is what it appears to be doing to your data, thus scrambling it beyond recognition. Another option is the define your columns as Varbinary and then performing your encoding outside of the database.