I'd like to convert a ASCII char* to wchar_t* in C++ on Linux without using mbstowcs(). On iOS and Windows, this works perfectly. On Android, however, mbstowcs seems to convert things quite literally, one-to-one. Even using different variations of setlocale(), I've been unable to successfully convert.
I might end up with just manually converting it on Android by copying 1 byte, and filling the rest with zeroes. But is this proper for ASCII? Are the first 255 characters of UTF-32/Unicode the same as the ASCII (ISO 8859-1/ISO Latin-1) character set?
Are the first 255 characters of UTF-32/Unicode the same as the ASCII character set?No, since ASCII only defines the first 128 characters. But they are the same as the first 128 Unicode characters."The first 256 code points were made identical to the content of ISO-8859-1".