Ucase and OEM to ANSI, won't work with Swedish åäö
Posted on 2008-11-19
I have i Pervasive table that is in DOS-format. Now building a program in VB 6. For a while the tables data need to stay in DOS-format.
1) Auto Translate=True in the connection string fixes the presentation of data.
2) CharToOemBuff converts fine when I'm writing data
3) The fields are not Case Insensitive
4) Did try PSQL 8.x and 9.5
5) Function CharToOem() uses API CharToOemBuff()
My problem is when using search on words with i.e. å, ä och ö in.
This works fine:
1) SELECT myfield FROM mytable WHERE Ucase(myfield) LIKE '%" & CharToOem("BIKE") & "%'"
Will find all fileds with Bike, BIKE and bike etc.
This will not work:
2) SELECT myfield FROM mytable WHERE Ucase(myfield) LIKE '%" & CharToOem("SÖNDAG") & "%'"
Will find words like SÖNDAG, sÖndag but not söndag.
3) SELECT myfield FROM mytable WHERE Lcase(myfield) LIKE '%" & CharToOem("söndag") & "%'"
Will find words like söndag but not SÖNDAG
The problem seams to be that SQL command Lcase() and Ucase() only convert a-z, not åäö etc.
Is my only option to adjust the 10 year old kernel in the dos-code to handle åäö?? That would be a pain...