<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19258">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Right !</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>with Textout, I get accents correctly</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>but... when I post the changes, now, I get the
problem</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Originally DAMMANS</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Changed to DéMMANS</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Display after editing</FONT></DIV>
<DIV><FONT size=2 face=Arial>DéMMANS (coorect)</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Saved in the CSV file as !!!!!<BR></FONT><FONT
size=2 face=Arial><FONT size=2 face=Arial>DéMMANS </FONT></FONT><FONT size=2
face=Arial><FONT size=2 face=Arial></FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial>and...</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial>when I display after new
loading :</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2
face=Arial>DéMMANS
(!!!!?!?!?!)</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial>Oups !!</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2 face=Arial><FONT size=2 face=Arial>GLBX</DIV></FONT></FONT>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=nc-gaertnma@netcologne.de
href="mailto:nc-gaertnma@netcologne.de">Mattias Gaertner</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=lazarus@lists.lazarus.freepascal.org
href="mailto:lazarus@lists.lazarus.freepascal.org">Lazarus mailing list</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, September 06, 2012 12:04
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Lazarus] Charset in
TSdfDataSet</DIV>
<DIV><BR></DIV>
<DIV><BR>GLBX <<A href="mailto:LBX@swing.be">LBX@swing.be</A>> 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>
<P>
<HR>
<P></P>--<BR>_______________________________________________<BR>Lazarus
mailing
list<BR>Lazarus@lists.lazarus.freepascal.org<BR>http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus<BR></BLOCKQUOTE></BODY></HTML>