(j3.2006) Get_Command_Argument

Craig Dedo craig
Thu Dec 15 12:12:33 EST 2011


> -----Original Message-----
> From: j3-bounces at j3-fortran.org [mailto:j3-bounces at j3-fortran.org] On Behalf Of
> Tobias Burnus
> Sent: Thursday, December 15, 2011 04:50
> To: j3 at j3-fortran.org
> Subject: Re: (j3.2006) Get_Command_Argument
> 
	<snip>
> 
> I have no idea how well that will work with file names on Windows, however. One can
> "fopen" a file with a UTF-8 file name ("ccs=UTF-8") but without Unicode support for
> OPEN/INQUIRE that won't happen and I would not be surprised if - depending on the
> input - one will get garbage file names. (Especially, since Windows likes 16-bit
> Unicode characters [e.g. for their wchar_t type and the w* API functions].)
> 
> Actually, for Windows, I also saw the request that it should be easy to convert a
> ISO_10646 into something passable to the Windows API. I think it was a UTF-16
> string, but I might misremember it; I recall that it was a data type (like UTF-8)
> where a single character could have different byte-widths.
> 
> Tobias
 
	<snip>

	FWIW, I checked my online documentation for Visual Studio 2008, printed
documentation for the Win32 API, and the Wikipedia article on NTFS.

	As far as I can tell, the native implementation for all character data in all
versions of Windows since Windows NT is UTF-16.  That is two octets for every character in
the Basic Multilingual Plane (BMP), including the ASCII characters in positions 0 - 127.
I don't know if there is native OS support for characters outside of the BMP, but the
UTF-16 specification in ISO 10646 has always provided for representation of characters in
the range of 0x10000 - 0x10FFFF using surrogate pairs in the S-Zone of 0xD800 - 0xDFFF.

	NTFS file names are always UTF-16 code points.

	Most Windows API functions that accept character string arguments are generic
identifiers that resolve to either ANSI or UTF-16 strings.

	Visual Studio and the Windows API define wchar_t to be an unsigned 16-bit integer.
All Unicode (i.e., UTF-16) character data is defined in terms of wchar_t.  

Sincerely,
Craig T. Dedo
17130 W. Burleigh Place
P. O. Box 423                  Mobile Phone:  (414) 412-5869
Brookfield, WI   53008-0423    E-mail:  <craig at ctdedo.com>
USA
Linked-In:  http://www.linkedin.com/in/craigdedo






More information about the J3 mailing list