Re: TCHAR string?



Daniel,

>> Then what does the "A" stands for at the end of Windows API functions
>> that accept non-Unicode strings?
>
> According to Microsoft's documentation the 'A' functions are "ANSI"
> rather than "Unicode" -- but that doesn't mean that "ANSI" is actually
> the right term to use.

Well, if it's close enough for the designers of Windows, I guess it's close
enough for me.

> The 'A' Windows API functions are used in "MBCS" builds, which tells us
> that they're intended to be used for multibyte (as well as single-byte)
> encodings that are based on narrow chars, so the 'A' suffix is a bit
> misleading ... I don't know how well the 'A' funtions perfom if you
> actually call them with multibyte sequences representing characters with
> codes greater than 255 (e.g. UTF-8) -- I tend to regard "MBCS" as a
> misspelling of "SBCS" and use Unicode if I need to encode anything
> outside the scope of ISO 8859-1.

Except of course, that not all versions of Windows support Unicode.

> This is very all a great pity, as conventional wisdom states that
> character string manipulation in programs is a hell of alot easier if all
> the characters are the same size in storage. What we really need is a
> 32-bit wchar.

Indeed.

--
Jonathan Wood
SoftCircuits
http://www.softcircuits.com


.



Relevant Pages

  • [Full-disclosure] Re: What A Click! [Internet Explorer]
    ... > tell your windows to open .HTA files in notepad. ... > (since there are more ways to cover windows with malicious lookalikes). ... >> Using custom Microsoft Agent characters it is possible to cover any kind ... including security or download dialogs. ...
    (Full-Disclosure)
  • Re: Tk 8.4.11 / Windows XP / Encoding problem
    ... Some of our clients are experiencing a weird problem on their Windows XP PCs. ... suddenly they start showing other characters instead of the correct utf-8 ... Tcl usually does proper detection of the system encoding. ...
    (comp.lang.tcl)
  • Re: File Attributes a real stumper
    ... Windows is based on that ANSI character set, or it may contain reserved windows names, such as 'com', 'lpt', or others. ... I've seen these type of files created using FTP, which supports ASCII, and an FTP server supports ASCII, and Windows will create it from FTP, but when you try to view it, or delete it, you'll have problems. ... A little background on undeletable files and folders: ... They would upload their illegal software to the FTP servers they find, but they would name the files and the folder they create with extended characters and symbols that FTP supports but Windows does not directly support, as well as create a very deep file structure with these extended unsupported ASCII characters, and/or file names with these characters that are greater than 256 characters. ...
    (microsoft.public.windows.server.general)
  • Re: Code Review - is this code shit
    ... of Windows files] will be seriously misread. ... of such characters are meant to be line separators (this would handle ... This is how best to use a crappy language for this purpose. ...
    (comp.lang.c)
  • Re: How many bytes per Italian character?
    ... yes I know how to ask Windows CE how big a buffer I'm going to need. ... and characters in Italian are the same size as characters in English, ... So have you detected that WinCE will cause a buffer overrun? ... It is not an error to tell you a string might be longer than it actually ...
    (microsoft.public.vc.mfc)

Loading