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;
}

locale and system laungues的更多相关文章

  1. [原创]java WEB学习笔记51:国际化 概述,API 之 locale类,dataFormat类,numberFormat类, MessageFormat类,ResourceBundle 类

    本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...

  2. Java Calendar,Date,DateFormat,TimeZone,Locale等时间相关内容的认知和使用(6) Locale

    本章介绍Locale. 1 Locale 介绍 Locale 表示地区.每一个Locale对象都代表了一个特定的地理.政治和文化地区. 在操作 Date, Calendar等表示日期/时间的对象时,经 ...

  3. ResourceBundle和Locale

    一.认识国际化资源文件   这个类提供软件国际化的捷径.通过此类,可以使您所编写的程序可以:          轻松地本地化或翻译成不同的语言          一次处理多个语言环境          ...

  4. JavaWeb的国际化

    国际化 1.国际化开发概述 1.1.软件的国际化 软件开发时,要使它能同时应对世界不同地区和国家的方法,并针对不同地区和国家的方法,提供相应的,符合来访者阅读习惯的页面或数据 国际化简称:i18n : ...

  5. Spring ApplicationContext 简解

    ApplicationContext是对BeanFactory的扩展,实现BeanFactory的所有功能,并添加了事件传播,国际化,资源文件处理等.   configure locations:(C ...

  6. 20个高级Java面试题汇总

    程序员面试指南:https://www.youtube.com/watch?v=0xcgzUdTO5MJava面试问题集合指南:https://www.youtube.com/watch?v=GnR4 ...

  7. [spring源码学习]八、IOC源码-messageSource

    一.代码实例 我们在第八章可以看到,spring的context在初始化的时候,会默认调用系统中的各种约定好的bean,其中第一个bean就是id为messageSource的bean,我们了解这应该 ...

  8. Android编程容易犯的错误之二

    11.不要太相信工具,比如Eclipse里面的断点遇到多线程什么,经常不起作用/走不到,还有就是如果语句为空的也不会走,这时候别太早下结论断点地方出错了, 所以每个工程都应该有日志的开关,通过查看日志 ...

  9. Structs框架

    一.准备工作及实例 1.解压struts-2.1.6-all.zip(structs网上下载) apps目录:struts2自带的例子程序 docs目录:官方文档. lib 目录:存放所有jar文件. ...

随机推荐

  1. foreach循环详解

    在Java1.5+中,foreach循环非常实用.   public class Demo <T> implements Iterable<T>, Iterator<T& ...

  2. adb server version (31) doesn't match this client (40); killing...

    删除360的手机助手即可解决,进程名字360MoblieMgr.exe

  3. 【SRM-06 D】五色战队&&【codeforces 788E】 New task

    原题链接:788E - New task Description 游行寺家里人们的发色多种多样,有基佬紫.原谅绿.少女粉.高级黑.相簿白等. 日向彼方:吾令人观其气,气成五彩,此天子气也. 琉璃:我们 ...

  4. 使用PHP+MySql操作——实现微信投票功能

    1. 投票主页面: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w ...

  5. DNN网络(二)反向传播算法

    本文摘自: https://www.cnblogs.com/pinard/p/6422831.html http://www.cnblogs.com/charlotte77/p/5629865.htm ...

  6. css控制继承

    inherit:继承父类. initial:继承浏览器. unset:重置为自然值,继承父类或者浏览器. revert:恢复原来的值. 详解: CSS为处理继承提供了四种特殊的通用属性值: inher ...

  7. kettle中的合并记录使用记录

    注意:合并记录的使用前提是2个数据源都按比较关键字排过序,否则合并之后的数据不准确,可能会多出很多. 该步骤用于将两个不同来源的数据合并,这两个来源的数据分别为旧数据和新数据,该步骤将旧数据和新数据按 ...

  8. 第26月第13天 hibernate导包

    1. https://yq.aliyun.com/ziliao/386827

  9. 第26月第7天 mac如何matplotlib中文乱码问题

    1.mac如何matplotlib中文乱码问题 先查看 ~/.matplotlib/fontList.json 添加SimHei字体(simhei.ttf文件)到 /Library/Framework ...

  10. 利用gcc的__attribute__编译属性section子项构建初始化函数表

    参考链接 :    https://my.oschina.net/u/180497/blog/177206