Skip to content

About

An Arduino library that converts UTF-8 string to GB2312 string.

Resources

Stars

13 stars

Watchers

2 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

Repository files navigation

简体中文 | English

UTF8ToGB2312

一个把UTF-8字符串转换成GB2312字符串的Arduino库。

已内置GB2312字库。

用法

  • 下载zip包。
  • 在Arduino IDE中安装库。
  • 引入头文件: #include "UTF8ToGB2312.h"。
  • 通过U2GB::get(<UTF-8字符串>);语句将UTF-8字符串转换成GB2312字符串。
  • 更详细用法请参考样例。
#include "UTF8ToGB2312.h"

// 在setup或loop函数中
U2GB::from("你好,世界!");
// 或使用from方法的别名get方法
U2GB::get("你好,世界!");

注意

只能转换在GB2312中已收录的字符,其余字符无法转换,否则可能出现乱码。#1

鸣谢

本库参考了 char_conversion。

其中 GB2312 字库表源自 GNU libiconv,遵循 LGPL-2.0-or-later 许可证。

About

An Arduino library that converts UTF-8 string to GB2312 string.

Resources

Stars

13 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages