towlower
在头文件<wctype.h>中定义 | | |
---|---|---|
wint_t towlower(wint_t wc); | | (自C95以来) |
如果可能,将给定的宽字符转换为小写字母。
参数
wc | - | 宽字符被转换 |
---|
返回值
如果在当前C语言环境中wc
未wc
列出小写版本,则为小写版本或未修改版本。
注意
这个函数只能执行1:1的字符映射,例如希腊大写字母'Σ'有两个小写形式,取决于单词中的位置:'σ'和'ς'。towlower
在这种情况下,调用不能用于获取正确的小写形式。
示例
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#include <locale.h>
int main(void)
{
wchar_t wc = L'\u0190'; // Latin capital open E ('Ɛ')
printf("in the default locale, towlower(%#x) = %#x\n", wc, towlower(wc));
setlocale(LC_ALL, "en_US.utf8");
printf("in Unicode locale, towlower(%#x) = %#x\n", wc, towlower(wc));
}
输出:
in the default locale, towlower(0x190) = 0x190
in Unicode locale, towlower(0x190) = 0x25b
参考
- C11标准(ISO/IEC 9899:2011):
- 7.30.3.1.1拖拉机功能(p: 453)
- C99标准(ISO/IEC 9899:1999):
- 7.25.3.1.1牵引机功能(p: 399)
另请参阅
towupper(C95) | 将宽字符转换为大写(函数) |
---|---|
降低 | 将字符转换为小写(函数) |
| C ++文件拖拉机|
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com