ForceWideStringFields in DOA 4.1.2

lecare039

Member²
What is the preferred way for an app to provide singlebyte and unicode support in DelphiXE? Currently I am trying to use the ForceWideStringFields property in the OracleDataSet. How to I have to set up the Size property of the TWideStringField? I have a data field defined as VARCHAR2(50 CHAR). If I set Size=50 it works for the singlebyte database but leads to wrong result with the unicode database. I also tried to set the OracleDictionary.CharacterSize to True with no effect.
 
The ForceWideStringFields property is indeed the best method to support single-byte and unicode databases, since all string fields will now be TWideStringFields.

What exactly do you mean by "wrong result" for unicode? Can you provide an example?
 
Thanks for your response. I have an TDBEdit attached to the Datasource of the OracleDataSet. When it posts data, the string is cut to half of the length. It seems that the size property of the TWideString field represents the byte size rather than the character size. This happens with unicode databases only. Using singlebyte the length of the string field is handled correctly.
 
Last edited:
Additional info: I noticed this happens when using special characters like the german umlauts. The characterset of the db is UTF-8. The data field is defined as VARCHAR2(50 CHAR). The TWideStringField.Size property is set to 50. OracleSession.ForceWideStringFields is true. TOracleSession.BytesPerCharacter is bcAutoDetect. I am using DelphiXE.

I need urgent help with this issue.
 
Last edited:
Back
Top