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. hihoCoder #1465 : 后缀自动机五·重复旋律8

    http://hihocoder.com/problemset/problem/1465 求S的循环同构串在T中的出现次数 将串S变成SS 枚举SS的每个位置i,求出以i结尾的SS的子串 与 T的最长 ...

  2. Linux命令(十四)gdb调试

    1. gdb调试 fun.c #include <stdio.h> #include "head.h" int sum(int a, int b) { printf(& ...

  3. Native APP ,Web APP,Hybrid APP三者对比

    Native APP Native APP 指的是原生程序(Android.iOS.WP),一般依托于操作系统,有很强的交互,可拓展性强,需要用户下载安装使用,是一个完整的App. 原生应用程序是某一 ...

  4. 可由inetd启动的协议无关时间获取服务器程序

    #include <time.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> ...

  5. verilog仿真文件编写

    verilog仿真文件大概框架: ·timescale 1ns/1ps //但需要时间 module xxx_tb(); //仿真文件不需要输入和输出, intput clk; ] xx; //根据需 ...

  6. mini2440开发板jilnk使用

    1.安装Setup_JLinkARM_V402d.exe软件 安装完成打开SEGGR J-FLASH ARM,界面如下: 2.用jlink将开发板与pc连接,打开开发板电源,将开关s2拨到nor fl ...

  7. MYSQL数据库安装记

    这回安装数据库装,做下记录. 1.下载mysql源安装包 shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8 ...

  8. 【python小练】0005

    第 0005 题:你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率的大小. 首先,iphone5的分辨率是1136x640. if条件句判断横(纵)向是否大于对应的ipho ...

  9. web api 过滤器

    /// <summary> /// 渠道过滤器 /// </summary> [AttributeUsage(AttributeTargets.Class | Attribut ...

  10. 玩转Google

    前言: 网上浏览信息,用百度搜索的时候,第一页都是广告,真是槽心到极点,果断放弃百度,现在用谷歌是真舒服,用起一句话用好谷歌.用好搜索引擎.你可以打开世界的大门! 加入特殊字符搜索: | 同时搜索关键 ...