Recent

Author Topic: Please explain Unicode and non-unicode support in lazarus  (Read 3677 times)

Человек_Борща

  • New Member
  • *
  • Posts: 33
    • My little IT world.
Please explain Unicode and non-unicode support in lazarus
« on: January 13, 2015, 07:24:19 am »
Greetings!

Please, explain me, what about unicode support in Lazarus?

It's supported or not in Lazarus/FPC, if yes, where it supported?

I need something like Delphi 2009 Unicode support.
In lazarus 1.2.6, function DeleteFile('some non ANSI chars(russian for example)') will not work propertly.

For the unicode support, I write two versions of one function:

Code: [Select]
{File 32bit CRC}
function GetCRC32OfFileA(const sFile: ansistring): ansistring; overload;
function GetCRC32OfFileW(const sFile: WideString): WideString; overload;

The first is ANSI version, compatible with string and UTF8String types. Russian "AS IS" chars will not work.
The second function, I rhink, will work with unicode chars without problems.


« Last Edit: January 13, 2015, 07:59:06 am by Человек_Борща »
With best regards, Alexandr.
_
OS: Windows 8.1 x64 / Ubuntu 14.02 x64
IDE: CodeTyphon 5.4 (win32-win64/win64) / FPC 3.1.1

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4468
  • I like bugs.
Re: Please explain Unicode and non-unicode support in lazarus
« Reply #1 on: January 13, 2015, 08:35:55 am »
Please, explain me, what about unicode support in Lazarus?

It is supported by AnsiString + UTF8 specific functions. See :
  http://wiki.freepascal.org/LCL_Unicode_Support

Lazarus 2.0 will improve things.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Please explain Unicode and non-unicode support in lazarus
« Reply #2 on: January 13, 2015, 01:39:37 pm »
The Windows unit won't really change in newer FPC versions, since that is the interface of Windows operating system, and windows won't suddenly start supporting utf8.

On Windows, Utf8 is for textfiles only, not for APIs.

The only change that still must happen is to switch the default names (e.g. GetCRC32OfFile) from the -A to the -W alias, similar like D2009 did

 

TinyPortal © 2005-2018