À, É を下位の à, è に変換できる C 関数は?
tolower() と tolower() を試しましたが、どちらも機能しません。
towlower関数を使用できます。
/* towlower example */
#include <stdio.h>
#include <wctype.h>
#include <wchar.h>
#include <stddef.h>
#include <locale.h>
int main () {
setlocale(LC_CTYPE, "");
int i=0;
wchar_t str[] = L"À TÉst String.\n";
wchar_t c;
while (str[i]) {
c = str[i];
putwchar (towlower(c));
i++;
}
return 0;
}
出力は次のとおりです。
à tést string.
"" 空の名前は、環境変数に基づいてロケールを選択することを示しています。