Converts a unicode string to ASCII.
-
Parameters:
-
str |
The handle to the ASCII string to be converted |
-
Returns:
-
wstring The resulting wide string
Converts a unicode string to ASCII using operating system dependent functions, which may depend on current locale settings.
By default, any character which cannot be converted from unicode to 8-bit ASCII will be replaced by '?'. If you'd like to use a different character for these conversion failures, pass it as the second argument.
If you don't want substitution characters used when a conversion error occurs, you may pass a null-character as the second argument ('\0'). In that case, if a conversion error occurs, the conversion procedure stops and EkWTOA returns the third argument to the function as a string.
Examples: EkWTOA (L"ABC") returns the string "ABC"
EkWTOA (L"A\400C") returns the string "A?C"
EkWTOA (L"A\400C",'.') returns the string "A.C"
EkWTOA (L"A\400C",'\0') returns the string ""
EkWTOA (L"A\400C",'\0',"DARN!") returns the string "DARN!"
|