Lazarus function pos can't read character "á" ....... lazarus / 1-Linux ---------------------------------------------------------------------- Robert W.B. · 2009-03-07 03:19 Hi friends.I'm doing a soccerapp and I use synapse to pick the soccer fixtures to a textfile and then I use pos to search for the fixture in the textfile. Everything is working fine but,when I try to let pos read Spanish fixtures like Málaga with the character "á" in the word, pos can't find it! I use Lazarus(0.9.26) in Linux Ubuntu 8.10  with string; Someone have an idéa? here's my soccerapp: http://hem.bredband.net/robbanux ---------------------------------------------------------------------- vvzh · 2009-03-07 07:23 It looks like an encoding problem, so the solution depends on the encoding of your text file. If you take text strings from Lazarus controls such as TEdit and then save them to a file, these strings will be in UTF-8 encoding. In this case you can use UTF8Pos instead of plain Pos. In order to use it you need to add LCLProcs to the unit "uses" clause. ---------------------------------------------------------------------- Robert W.B. · 2009-03-08 22:51 what You suggested dosen't work for me in Linux! I use cwstring unit and WideString in linux but  characters like "á"  "é" will only shows like this "?" ex: Málaga=M?laga   Atléticho=Atl?ticho Anyone knows the sollution? Linux Ubuntu Lazarus 0.9.26 FPC 2.2.3 ---------------------------------------------------------------------- bonmario · 2009-03-09 07:33 Quote from: robbanux on March 08, 2009, 11:51:20 pmwhat You suggested dosen't work for me in Linux! I use cwstring unit and WideString in linux but  characters like "á"  "é" will only shows like this "?" ex: Málaga=M?laga   Atléticho=Atl?ticho Anyone knows the sollution? Linux Ubuntu Lazarus 0.9.26 FPC 2.2.3 You can try to convert in UTF8 format the string before to use "Pos": WrkStr:=UTF8Encode(YourString); WrkPos:=Pos('à', WrkStr); ---------------------------------------------------------------------- theo · 2009-03-09 09:17 Quote from: robbanux on March 08, 2009, 11:51:20 pmI use cwstring unit and WideString in linux You don't need WideString, just leave it UTF-8 (AnsiString).