Grid, accent and drawText lazarus / 31-LCL ---------------------------------------------------------------------- Nicola Gorlandi · 2016-08-27 07:00 Hi, I want do draw in a cell of a TDBGrid some content so a write this code Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i    s:=field.asString;  r:=rect;  inflaterect(r,-1,-1);  r.right:=r.right-getsystemmetrics(SM_CXVSCROLL);  drawtext(canvas.handle,pchar(s),-1,r,DT_WORDBREAK or DT_NOPREFIX);   well the issue is that if the content is something like "più" in the cell it is display pi and some strange char. The other strange think is that if a write   drawtext(canvas.handle,'più',-1,r,DT_WORDBREAK or DT_NOPREFIX); everything works fine. I use a Sqlite database. Many thanks ---------------------------------------------------------------------- Blaazen · 2016-08-27 15:16 I got older Lazarus 1.7 trunk (r.51976) and both ThemeServices.DrawText() methods expect string as a parameter. Maybe they expected PChar in the past, I'm not sure now. Anyway, try to replace "pchar(s)" with simply "s". ---------------------------------------------------------------------- Nicola Gorlandi · 2016-08-29 05:08 I am using Lazarus 1.6 (official release). the drawtext procedure does not allow me to use directly s but only a pointer, the drawtext that I am using is in redef.inc. Anyway, I finally solved changing the code as below Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i    s:=field.asWideString;  r:=rect;  inflaterect(r,-1,-1);  r.right:=r.right-getsystemmetrics(SM_CXVSCROLL);  drawtextw(canvas.handle,pwidechar(s),-1,r,DT_WORDBREAK or DT_NOPREFIX); Thanks