[fpc-pascal] code example where AnsiString used in FCL (SqlDB) causes data loss

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed May 11 14:07:03 CEST 2016


On 2016-05-11 12:03, Graeme Geldenhuys wrote:
> Console output:
> 
> [unicode_test]$ export LANG=en_US.UTF-8
> [unicode_test]$ ./unicodetest
> 65001
> 
> [unicode_test]$ export LANG=en_US.ISO8859-1
> [unicode_test]$ ./unicodetest
> 28591

Just to add, compiling that test program with FPC 2.6.4 I get the
correct output in output.data, no matter what my locale setting is.
That's what I meant by the fact that I can accurately assume AnsiString
contains a UTF-8 payload (because I'm reading UTF-8 data), and that the
RTL and FCL did not make any encoding conversions.


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp



More information about the fpc-pascal mailing list