locale and system laungues
In computing, a locale is a set of parameters that defines the user's language, region and any special variant preferences that the user wants to see in their user interface.
Usually a locale identifier consists of at least a language identifier and a region identifier.
on windows, use codepage instead of locale;
(narrowly speaking, locale decides the format how to show symbols like dollar and date, related to region;language enable and decide the way fonts are shown)
winodows use UTF-16 as the internal encoding for string literals, Unix-like system use UTF-8;
we can enforce windows to encode/decode strings with UTF-8;
before input a char, we should first choose an input language, so that keys can be convert to the char we want;
if bytes array of string A (encoded in UTF-16) is \x33\x44\x55, if we pass UTF-8 version bytes array of same string "\x33\x44\x56\x55", a win function can't find sting A;
language pack contains fonts to be used.
copy an string is copying a list of fonts?
u"charssss" in c++ means that this array is encoded in one implementation of Unicode? like utf-8 or utf-16, and its impiler-dependent.
example:
#include<iostream>
#include<string>
#include<codecvt>
using namespace std; int main()
{
char d1[] = u8"\xE6\x8E\x96";
char d2= u8"中国银行";
char16_t d3[] = u"中国银行";
string d4 = wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t>{}.to_bytes(d3);
cout << d1 << endl;
cout << d2 << endl;
wcout << d3 << endl;
cout <<d4 << endl;
}
最新文章
- python3安装lxml(windows)
- hdoj 4323
- PHP校验ISBN码的函数
- Windows C盘格式化或者同平台迁移oracle数据库
- HtmlAgilityPack --解析Html源码
- TNetHttpClient支持异步访问(Delphi 10.1 Berlin,红鱼儿的博客)
- Actor模型[转]
- 13. leetcode 453. Minimum Moves to Equal Array Elements
- MySQL 6.0安装图解
- [LeetCode]Count and Say 计数和发言
- .net 发布程序时出现“类型ASP.global_asax同时存在于...”错误的解决办法
- 海外aws-ubuntu-16.04系统使用ansible安装tidb
- MySQL简单查询语句练习
- 【Java基础】14、位运算之——按位与(&;)操作——(快速取模算法)
- HDU 6124 17多校7 Euler theorem(简单思维题)
- Map接口的使用
- Can&#39;t locate Data/Dumper.pm in perl5的处理
- 【codeforces 623E】 Transforming Sequence
- GP开发示例:数据库去重
- Mac OS Yosemite 文件批量重命名