Phytec中国的wiki
support@phytec.cn
热线:0755-61802110-803
KERNEL支持中文编码
使用menuconfig对Linux内核进行配置,
bitbake linux-ti -c menuconfig (AM335X) bitbake linux-mainline -c menuconfig (i.MX6)
菜单的File systems – > Native language support下 ,找到以下三行,选中
<*> Simplified Chinese charset (CP936, GB2312) <*> Traditional Chinese charset (Big5) <*> NLS UTF-8
系统支持中文语言包
在BSP的conf/local.conf文件中增加以下配置
GLIBC_GENERATE_LOCALES = "zh_CN.UTF-8 en_GB.UTF-8 en_US.UTF-8" IMAGE_LINGUAS_append = " zh-cn" LOCALE_UTF8_ONLY="1"
重新编译内核,镜像,开发板重新更新内核,文件系统
bitbake linux-mainline -c comfile -f bitbake linux-mainline -c deploy bitbake phytec-qt5demo-image
Linux 系统配置
配置系统的语言环境, 可在/etc/profile增加以下内容
export LC_ALL=zh_CN.UTF-8 export LANGUAGE=zh_CN.UTF-8 export LANG=zh_CN.UTF-8
退出后, 执行sync保存, 然后重启系统即可.
测试方法
以上配置后, 此时就能在系统中创建中文文件和目录.
将sd卡或者U盘以utf8格式挂载在开发板上, 就能看到中文内容。
mkdir /mnt/mmc mount /dev/mmcblk0p1 /mnt/mmc -o utf8 ls /mnt/mmc
Overview
Content Tools
Activity
Tasks