Recent

Author Topic: 0.9.26. and upwards - UTF-8 string problems?  (Read 6115 times)

Caleb

  • New member
  • *
  • Posts: 8
0.9.26. and upwards - UTF-8 string problems?
« on: March 04, 2009, 10:57:17 am »
Hi,

since I've upgraded to the mentioned version (and also tried an SVN build, with same results), I'm having a strange issue.

My app is loading data from an UTF-8 XML file (generated by xmlwrite unit, read by xmlread). None of the lines with accented characters (since it's Hungarian, there's many of them) show up in a listbox. After reading through some forum posts and wikis, I tried the ansitoutf8 function, and that worked - though I don't think an UTF-8 XML should contain ANSI strings.

The problems don't end here, though. After I try to compare to UTF8string typed variables, the debugger stops with fpc_ansistr_compare_equal errors, and I don't see why.

Did anyone run into the same things?

Thanks,

Caleb

Caleb

  • New member
  • *
  • Posts: 8
Re: 0.9.26. and upwards - UTF-8 string problems?
« Reply #1 on: March 04, 2009, 02:03:24 pm »
After changing every string definition to UTF8String, and adding conversions to every place where it's necessary, it seems to be working again. Well, only a day lost from the two I have on the project, could be worse. I still don't understand the problem, though.
 

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: 0.9.26. and upwards - UTF-8 string problems?
« Reply #2 on: March 10, 2009, 01:06:19 am »
Your message misses some very important information: Operating System, Widgetset and FPC and Lazarus version

About your questions, a remark: UTF8String at the moment is exactly the same as string=ansistring, no difference at all. This will probably change in the future.

For the rest I can't answer without knowing the missing information, but you can start by reading:

http://wiki.lazarus.freepascal.org/LCL_Unicode_Support

thanks,

Caleb

  • New member
  • *
  • Posts: 8
Re: 0.9.26. and upwards - UTF-8 string problems?
« Reply #3 on: March 11, 2009, 01:08:10 pm »
OS: Windows XP SP2 Hungarian
Widgetset: win32 (if that it is)
FPC ver.: 2.2.2
Lazarus: 0.9.26. (svn 16885)


felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: 0.9.26. and upwards - UTF-8 string problems?
« Reply #4 on: March 12, 2009, 04:46:33 pm »
A code snipet would also help.

And you can also try subversion Lazarus.

 

TinyPortal © 2005-2018