Closed gabriel-curtino closed 2 years ago
I can send you some of these files but cannot attach them here...
Please email a copy of the dbf to me at keithm@infused.org and I will take a look.
Thank you, Keith
I just released version 4.2.1, which should fix this issue. Please give it a try and let me know if it works for you.
It seems the new realease reads the headers properly but I'm not sure about the content.
$ dbf -s ci_A.dbf
Database: ci_A.dbf
Type: (04) dBase IV without memo file
Memo File: false
Records: 26
Fields:
Name Type Length Decimal
------------------------------------------------------------------------------
D1 I 4 0
S1 C 8 0
Reading the table without any encoding fails
require "dbf"
table = DBF::Table.new('ci_A.dbf')
table.each do |r|
puts r.s1
end
>> "\x94" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
Reading the table with any encoding works. I don't really know the content of this tables and if some encryption/obfuscation is being used. It might be the case as it seems String fields have non readable info. But, in the other side, Integer fields also have weird values.
require "dbf"
table = DBF::Table.new('ci_A.dbf', nil, 'cp866')
table.each do |r|
puts r.d1.to_s + " == " + r.s1.to_s
end
>> 16777344 == Ф!╬╓ЇХ8╤
>> 33554560 == Ф"╬╓ЛХ7▄
>> 50331776 == Ф#╬╒УХ6э
>> 67108992 == Ф$╬╙тХ5▐
...
>> 26
Using this Paradox dBase Reader it shows this:
This is another example:
Database: ax.dbf
Type: (04) dBase IV without memo file
Memo File: false
Records: 29871
Fields:
Name Type Length Decimal
------------------------------------------------------------------------------
D1 C 6 0
D2 I 4 0
...
"0Z9U04","-1360976512"
"0Z9U08","-695786112"
"0Z9U08","-632150912"
"0Z9U08","1985094784"
"0Z9U08","-1360976512"
"0Z9U20","-632150912"
"0ZJK02","-366334592"
"0ZJK02","-2044056192"
"0ZJK02","573189504"
"0ZJK02","-1305793152"
"0ZJK03","-2044056192"
Thanks!
Hi!
I got this error with a file type (04) dBase IV without memo file. Maybe related to #95.
Using ruby 2.7.4, 3.0.3 and 3.1.2. Always with dbf 4.2.0.