FMX/Android: wchar_t support

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

Post Reply
Nemo
Posts: 3
Joined: Wed Feb 28, 2018 11:09 am

FMX/Android: wchar_t support

Post by Nemo »

I am a beginner with FMX/Android and tried to make a test app. The code wanted to use the function _wcsnicmp() but it does not seem to exist for Android, only for Windows. However, wcsncmp() seems to exist. Does anyone know if this is the case or am I looking in the wrong place?
rlebeau
BCBJ Author
BCBJ Author
Posts: 1716
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA
Contact:

Re: FMX/Android: wchar_t support

Post by rlebeau »

Nemo wrote:I am a beginner with FMX/Android and tried to make a test app. The code wanted to use the function _wcsnicmp() but it does not seem to exist for Android, only for Windows. However, wcsncmp() seems to exist. Does anyone know if this is the case or am I looking in the wrong place?
On Windows, wchar_t is 16bits used for UTF-16, but on other platforms it is 32bit used for UTF-32. So, to ensure that UnicodeString is always a 16bit UTF-16 string on all platforms, it uses wchar_t on Windows (the "classic" compiler does not support char16_t), and char16_t on other platforms. So, you need to find/use cross-platform functions that are compatible with char16_t strings. Or, use C++Builder RTL cross-platform functions that are compatible with UnicodeString/WideChar strings instead of raw wchar_t/char_16 strings.
Remy Lebeau (TeamB)
Lebeau Software
Post Reply