Ludovic Rousseau wrote:
> On 25/04/06, Karsten Ohme <[EMAIL PROTECTED]> wrote:
> 
>>shoichi wrote:
>>
>>>It works!Just LPSTR -->LPTSTR
>>>
>>>LPCSTR -->LPCTSTR
>>>What's the different betwween without"T" and with "T"?
>>
>>Support of Unicode. Microsoft uses the UTF-16 format (?), every
>>character is coded with two bytes (this is near the truth) to support
>>all languages, good for internationalization of programs. Without the T
>>only the charset of the system is used, e.g. ASCII.
> 
> 
> Ah ok. That's why the MSDN sample code for SCardListReaders() uses
> "printf("Reader: %S\n", pReader );" (note the capital S in %S).
> 
> So we have an API difference between pcsc-lite and MS PC/SC :-(
> 
> 
>>(But pcsc-lite has no support for Unicode.)
> 
> 
> pcsc-lite can use UTF-8 since the reader name is transparent for
> pcs-lite. Just put whatever reader name you want /etc/reader.conf of
> Info.plist.
> 
> I don't know why MS chose to use UTF-16 instead of UTF-8. UTF-8 is
> backward compatible with ASCII so (very) easy to migrate to.

For the most languages this would make trouble. E.g. Asian languages use
two bytes. So independent of the locale the programmer can allocate two
bytes (actually a TCHAR) (if UNICODE is defined). With UTF-8 you must
parse the string (get the string length) to get the real physical size
of the string, because ASCII is coded on the seven lower bits and the
MSB decides about a next byte to get a whole character. I assume this is
a reason so that it seams to be simpler.

Java also uses UTF-16.

Karsten

> 
> Bye,
> 
> --
>   Dr Ludovic Rousseau
> 
> _______________________________________________
> Muscle mailing list
> [email protected]
> http://lists.drizzle.com/mailman/listinfo/muscle

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to