UTF-8到ASCII使用ICU库 [英] UTF-8 to ASCII using ICU Library

查看:239
本文介绍了UTF-8到ASCII使用ICU库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有UTF-8字符的std :: string。

我要将字符串转换为与ASCII字符最接近的字符。

I have a std::string with UTF-8 characters in it.
I want to convert the string to its closest equivalent with ASCII characters.

例如:

Łódź=> Lodz

Assunção=> Assuncao

Schloß=> Schloss

Łódź => Lodz
Assunção => Assuncao
Schloß => Schloss

不幸的是,ICU图书馆是非常不直观的,我还没有找到有关其使用的好文档,所以它需要我太多时间来学习使用它。时间我没有。

Unfortunatly ICU library is realy unintuitive and I haven't found good documentation on its usage, so it would take me too much time to learn to use it. Time I dont have.

有人可以举一个例子,如何做到这一点?

谢谢。

Could someone give a little example about how can this be done??
thanks.

推荐答案

这篇关于UTF-8到ASCII使用ICU库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆