字符串比较和unicode [英] String comparison and unicode

查看:324
本文介绍了字符串比较和unicode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Qt中使用qSort对包含结构的QList进行排序.我注意到波兰语字符Ś"在排序列表的末尾或开头(取决于顺序).是否有任何字符串比较函数将Ś"放在"S"旁边?

I'm using qSort in Qt to sort QList containing struct. I noticed that Polish character "Ś" is at the end or beginning of sorted list (depending on order). Is there any string comparison function which places "Ś" next to "S"?

推荐答案

您需要使用QString::localeAwareCompare作为比较功能.

You need to use QString::localeAwareCompare for your comparison function.

这篇关于字符串比较和unicode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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