Is it possible to suppress character conversion?

I have a foxpro table with a memo-field (containing binary data) that I want to use in Servoy.

Foxpro table codepage: 1252
URL: jdbc:dbf:/c:\foxpro_tables?charSet=Cp1252
Driver: com.hxtt.sql.dbf.DBFDriver
Version: 4.2.212 on March 10, 2011 (shipped with servoy 6)

When addressing the memo-field character conversion is done, so for instance:
In foxpro the binary value of position x of memo_field is 129
In servoy foundset.memo_field.charCodeAt() is 65533

For binary fields I don’t want this character conversion so I want to suppress this. Is this possible in any way?

(I used to use a trick to avoid character conversion, just pretended that the foxpro-tables were ISO8859_1
URL: jdbc:dbf:/c:\foxpro_tables?charSet=ISO8859_1
Driver: com.hxtt.sql.dbf.DBFDriver
Version: 4.2.047 on February 21, 2009
No character conversion was done, so:
In foxpro the binary value of position x of memo_field is 129
In servoy foundset.memo_field[x].charCodeAt() is 129
Voila!
But after switching to the new HXTT driver (version 4.2.212) character conversion was done again :cry: :
In foxpro the binary value of position x of memo_field is 129
In servoy foundset.memo_field[x].charCodeAt() is 65533)

No other Foxpro users converting to Servoy who face this problem?

Michel,

Maybe you can try the hxtt forum?

http://www.hxtt.com/support.jsp?product=dbf

Rob

No need, the answer is here: http://www.hxtt.com/document.jsp?product=dbf:

  1. While reading encrypted data in a DBF file using u’r parser in java. The data retreived is different from the data in
    the DBF file, certain characters are read as ? marks.( the encryption is done using ASCII values ).
    You can use ResultSet.getBytes(int columnIndex), not ResultSet.getString(int columnIndex) and ResultSet.getObject(int
    columnIndex), to get your encrypted data, since your encrypted data is binary stream.

How can I get Servoy to use ResultSet.getBytes() in stead of ResultSet.getString() when I address foundset.memo_field

Michel,

Am I right to think that the column does not contain binary data, but a string encoded as bytes?

The resultset.getString() should return the same string with the correct encoding applied.
You don’t want to suppress conversion, you need to apply the same encoding as used when the string is saved.

Rob

Hi Rob,

The column does contain binary data, so I do want to suppress the character conversion.

Kind regards,

Michel,

What is the column type (in servoy, foxpro and jdbc)?

Rob

Foxpro: MEMO
Servoy: TEXT(0)
JDBC: how can I determine that?

but if it is a MEMO which is reported as TEXT then servoy will call getString() to get it, because the driver tells us that that is is text…

If you store binary data use a binary column (so a MEDIA type in servoy)