Recent

Author Topic: Display correctly special characters in a StringGrid in Linux  (Read 3988 times)

fredycc

  • Sr. Member
  • ****
  • Posts: 265
Display correctly special characters in a StringGrid in Linux
« on: December 04, 2009, 06:01:24 pm »
Hello, I compiled a program in Windows, the firts problem was how to display the letter Ñ, then I found in the forum that you can use functions like UFT8Encode & UTF8Decode, this works great, I can pass the SQL sentence with Ñ and then display word with letters like Ñ with any problem.  :)

After that I try to compile the same application in Linux OpenSuse 11.2 the programs compile without problem but the SQL sentence the letter Ñ appears like #209, when I display all the data from the table the Ñ appears like ?  :-\; What I need to do for this letters appers correctly in Linux applications?  :(

I use a database in Firebird 2.1.2, Charset ISO 8859_1. 
Lazarus 0.9.28.2 beta in both Windows Vista & OpenSuse11.2.
I display data in a StringGrid.

Thanks again.



theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: Display correctly special characters in a StringGrid in Linux
« Reply #1 on: December 04, 2009, 06:23:49 pm »
In unit LConvEncoding there is a function: ISO_8859_1ToUTF8();

fredycc

  • Sr. Member
  • ****
  • Posts: 265
Re: Display correctly special characters in a StringGrid in Linux
« Reply #2 on: December 04, 2009, 08:09:14 pm »
Thanks Theo, works perfectly, only a last question about it. I try to pass the next query:
Mythread.sqlStr := Format('Select * from cat_mun where cat_mun.nom_mun_ine like %0:s',['''%Ñ%'''])

And nothings return; I check the variable sqlStr & this showme:
Select * from cat_mun where cat_mun.nom_mun_ine like "%'#209'%"

I use UTF8Encode in windows and works fine:
Select * from cat_mun where cat_mun.nom_mun_ine like "%'Ñ'%"

But in linux doesn't works  :-\.

Thanks a lot, Muchas Gracias in Spanish.