简体   繁体   English

什么是用于 C++ UTF-8/UTF-16 文本编码的小型 LGPL 库?

[英]What's a small LGPL library for C++ UTF-8/UTF-16 text encoding?

Need something small and portable.需要一些小巧便携的东西。 Currently looking at UTF8-CPP but thought that I'd reach out for other suggestions too.目前正在研究 UTF8-CPP,但认为我也会寻求其他建议。

Cheers.干杯。

UTF-8CPP it is, just want to mark this question as done with.是UTF-8CPP,只是想将此问题标记为已完成。 Thanks for all the help guys:)感谢所有帮助的家伙:)

ICU is an "International Components for Unicode" - portable and open source. ICU是一个“Unicode 的国际组件”——可移植和开源。

Haven't used it myself, so I can't say how good it is, but I know others that do.我自己没有用过,所以我不能说它有多好,但我知道其他人这样做。

Ironically enough, the best/easiest/most robust way is to wrap Unicode-aware stdlib (C) functions like setlocale(), wprintf() and mbstowcs in your own, application-level) C++ classes.具有讽刺意味的是,最好/最简单/最健壮的方法是在您自己的应用程序级 C++ 类中包装可识别 Unicode 的 stdlib (C) 函数,如 setlocale()、wprintf() 和 mbstowcs。 The APIs are portable, and they've been in use for many years. API 是可移植的,并且已经使用了很多年。

A few links:几个链接:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C ++ unicode UTF-16编码 - C++ unicode UTF-16 encoding 如何使用C ++将UTF-16转换为UTF-8? - How to convert UTF-16 to UTF-8 using C++? MFC 中的 C++ UTF-8/ASCII 到 UTF-16 - C++ UTF-8/ASCII to UTF-16 in MFC 使用标准C ++ wifstream读取UTF-8文本并转换为UTF-16 - Reading UTF-8 text and converting to UTF-16 using standard C++ wifstream 对C ++的std :: wstring,UTF-16,UTF-8以及在Windows GUI中显示字符串感到困惑 - Confused about C++'s std::wstring, UTF-16, UTF-8 and displaying strings in a windows GUI 如何使用C ++将文件从Windows utf-16或Windows utf-8转换为Unix utf-16 - How to convert file from windows utf-16 or windows utf-8 to unix utf-16 with C++ Microsoft如何处理UTF-16在其C ++标准库实现中是可变长度编码的事实 - How does Microsoft handle the fact that UTF-16 is a variable length encoding in their C++ standard library implementation 在C ++中内部使用UTF-8,UTF-16,UTF-32? - Working with UTF-8 vs UTF-16 vs UTF-32 internally within C++? Windows使用什么unicode编码(UTF-8,UTF-16,其他)作为其Unicode数据类型? - What unicode encoding (UTF-8, UTF-16, other) does Windows use for its Unicode data types? 从UTF-8到UTF-16大字节序的字符串转换失败(使用C,C ++语言) - String conversion from UTF-8 to UTF-16 Big endian is failing (using C, C++ language)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM