Re: Delphi 2009 - CG tip everything on ( only ) Unicode ?



Francisco Ruiz wrote:

unicode based code will be faster than ansi based?

The Unicode versions of the Win32 API calls are faster then the ANSI
versions of the same API calls because on all NT based systems the ANSI
versions are implemented as a wrapper around the Unicode version which
performs an ANSI -> Unicode -> ANSI conversion for all string values
going in and out.

The Unicode versions are the native API of NT based Windows, the ANSI
versions just have been preserved to keep binary compatibility for
applications that are written to run on Win9x (where the "native" API
was the ANSI one and most of the Unicode API is not even implemented).

Beyond all the differences there is also the fundamental problem of
using the ANSI APIs to access files. NTFS is fully unicode enabled, so
file and folder names are in Unicode. It's perfectly possible that
someone installed your application in a folder which contains
characters that can not be represented in the current ANSI codepages.
Or that a user selects a file in a file open dialog which contains
characters in folder or filename which can not be represented in the
current ANSI codepage. If you are using the ANSI APIs you will not be
able to access these files or folders.

--

.



Relevant Pages

  • Re: A (mild-mannered) defense of RosAsm Rocks !!!
    ... All functions that have a Unicode ... and ANSI implementation are Unicode first, ... this API is not available in Win9x without the ... Oh by the way the Coward is the asshole that wrote the peice of garbage ...
    (alt.lang.asm)
  • Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
    ... No, not quite, because the VCL is still Unicode so your application will ... to continue to safely run in an "ANSI world" ... This compiles perfectly fine, but maybe it doesn't work correctly for ... "choose" the A/W API, you get the API appropriate to the sype of the ...
    (borland.public.delphi.non-technical)
  • Re: Another unicode problem
    ... coerces text from Unicode to ANSI, it is often a destructive process. ... ANSI API call trys to call a 'W' function, it will not be receiving the ... Pass the string using StrPtr. ...
    (microsoft.public.vb.general.discussion)
  • Re: Convert 97-2002 PST files to 2003 Format and Transfer to New C
    ... Will this data be coverted to the new Unicode format? ... default folder of a particular name. ... Open each of the folders in the ANSI ... The conversion to Unicode will happen in the copy. ...
    (microsoft.public.outlook.installation)
  • Re: Code Page problem in SetWindowText
    ... I've had lots of people insist that it is faster to use ANSI apps because "the strings are ... They don't realize that since all of WIndows is written in Unicode, every ANSI ... API, so ANSI would be inherently slower. ...
    (microsoft.public.vc.mfc)

Loading