首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::towlower

Defined in header <cwctype>

std::wint_t towlower( std::wint_t ch );

如果可能,将给定的宽字符转换为小写。

参数

ch

-

wide character to be converted

返回值

小写版本ch或未经修改ch如果在当前C语言环境中没有列出小写版本。

注记

这个函数只能执行01:1的字符映射,例如,希腊大写字母%27Σ%27有两个小写形式,取决于单词中的位置:%27σ%27和%27%100。打电话给std::towlower在这种情况下,无法使用它获得正确的小写形式。

二次

代码语言:javascript
复制
#include <iostream>
#include <cwctype>
#include <clocale>
 
int main()
{
    wchar_t c = L'\u0190'; // Latin capital open E ('Ɛ')
 
    std::cout << std::hex << std::showbase;
    std::cout << "in the default locale, towlower(" << (std::wint_t)c << ") = "
              << std::towlower(c) << '\n';
    std::setlocale(LC_ALL, "en_US.utf8");
    std::cout << "in Unicode locale, towlower(" << (std::wint_t)c << ") = "
              << std::towlower(c) << '\n';
}

二次

产出:

二次

代码语言:javascript
复制
in the default locale, towlower(0x190) = 0x190
in Unicode locale, towlower(0x190) = 0x25b

二次

另见

towupper

converts a wide character to uppercase (function)

tolower(std::locale)

converts a character to lowercase using the ctype facet of a locale (function template)

tolower

converts a character to lowercase (function)

C拖曳文件

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券