<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head><body style="">
<div>
<br/>GLBX <LBX@swing.be> hat am 6. September 2012 um 11:36 geschrieben:
<br/>> Hi,
<br/>>
<br/>> I checked the encodings and got :
<br/>>
<br/>> - GuessEncoding(dataset .fields[1].asString) and got UTF8
</div>
<div>
</div>
<div>
Keep in mind that it is impossible to reliably get the codepage of a text, unless the text begins with a BOM. GuessEncoding simply checks if the string validates some UTF-8 rules. If it is valid it returns UTF-8 otherwise the system code page.
</div>
<div>
</div>
<div>
<br/>> - [application]defaultTextEncoding = cp1252
<br/>>
<br/>> Now in DBGrid I wrote in DrawColumnCell :
<br/>> ...
<br/>> ExtTextOut( .... UTF8ToISO_8859_1(dataCSV.Fields[datacol].AsString......)
<br/>> and.....
<br/>> Now accents are correctly displayed...
</div>
<div>
</div>
<div>
It seems you are calling the windows API function ExtTextOut directly instead of the x-platform LCL one. The LCL one expects UTF-8, so you don't need the conversion.
</div>
<div>
</div>
<div>
<br/>> But I will get the problem back when validating changes in fields !!!
<br/>> (I Tried with OnSetText : but inefficient !)
</div>
<div>
</div>
<div>
Mattias
</div>
<div>
</div>
</body></html>