[Lazarus] UTF16 2 utf8

Joost van der Sluis joost at cnoc.nl
Wed May 4 13:18:03 CEST 2011


On Wed, 2011-05-04 at 12:19 +0200, Eduard Filipas wrote:
> Hi all
> 
> im bit lost with all this unicode support ..im tryin to make picture in 
> my head..here is my problem
> 
> MS-SQLserver 2008 uses utf16 to represent data

It does? Not by default. If you define your fields as varchar(x), it can
be used to use UTF-8. nvarchar is utf-16 by default, off course.

> lazarus uses UTF8
> FPC doesnt use unicode
> 
> my first question is ..is it possible at all to present valid data in 
> program compiled with lazarus that connects to MSSQL server?

Just set your connection to UTF-8 and you're done. It doesn't matter how
the data is stored. (But if you can choose, use nvarchar, so no
conversion is needed)

Joost.





More information about the Lazarus mailing list