哪个 C 函数可以将 À、É 转换为小写 à、è?
我尝试了 tolower() 和 towlower(),但都不起作用。
最佳答案
您可以使用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.
“” 空名称表示根据环境变量选择区域设置。
关于c - 哪个 C 函数可以将 À、É 转换为小写 à、è?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38428135/