Unicode字符串 [英] Unicode strings

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

问题描述

大家好,


我应该用什么策略来解决以下问题?我有一个列表

的unicode字符串,我想用它的英语语言比较

''等价。'''


reykjavík (注意i之上的重音)应该与reykjavík相匹配。和

" reykjavik" (相当于英语)。


类似地,德语字母'''''应匹配ss,umlauted a',

o等等应该匹配a,o等。


如何使用c ++ stdlib进行此操作?


非常感谢,


Andrew

Hello all,

What strategy should I use in solving the following problem? I have a list
of unicode strings which I would like to compare with its English language
''equivalent.'' eg

"reykjavík" (note the accent above the i) should match both "reykjavík" and
"reykjavik" (being the English equivalent).

Similarly the German language letter ''?'' should match "ss", umlauted a''s,
o''s etc should match a,o etc.

How would I go about doing this using the c++ stdlib?

Many thanks,

Andrew

推荐答案

2004年6月22日星期二13:12:33 +0100,Andrew L $ / $
< an ************ @ operamail.com>写道:
On Tue, 22 Jun 2004 13:12:33 +0100, Andrew L
<an************@operamail.com> wrote:
大家好,

我应该用什么策略来解决以下问题?我有一个unicode字符串的列表,我想用它的英语来比较
''等价。'''

"reykjavík" (注意i之上的重音)应该与reykjavík相匹配。和雷克雅未克 (相当于英语)。

类似地,德语字母'''''应与ss相匹配,uclauted a',
o'等应匹配a ,等等。

如何使用c ++ stdlib进行此操作?

非常感谢,

Andrew
Hello all,

What strategy should I use in solving the following problem? I have a list
of unicode strings which I would like to compare with its English language
''equivalent.'' eg

"reykjavík" (note the accent above the i) should match both "reykjavík" and
"reykjavik" (being the English equivalent).

Similarly the German language letter ''?'' should match "ss", umlauted a''s,
o''s etc should match a,o etc.

How would I go about doing this using the c++ stdlib?

Many thanks,

Andrew




你必须实现某种查找表或字典。


虽然STL支持语言环境,但我认为没有办法

比较*不同*语言环境中的两个字符串...特别是对于

Unicode字符串,因为没有Unicode的语言环境 - Unicode

覆盖*所有*区域设置。


此外,有许多单词表示一种语言中的一种(或

语言环境)和其他不同语言的单词,虽然他们是完全相同的
拼写。 "频带"在德语中可能是一个不同的词

而不是band例如,英语。


即使你摆脱了特殊字符,你也必须真正看出

out(例如德语Pr?servative)。和英语防腐剂< g>)。

-

Bob Hairgrove
没有********** @ Home.com


Bob Hairgrove写道:
Bob Hairgrove wrote:

[snip]
即使你摆脱了特殊字符,你也必须真正看出
(例如德语Pr?servative和英语防腐剂 ;< g>)。
[snip]
Even if you get rid of the special characters, you must really watch
out (e.g. German "Pr?servative" and English "preservative" <g>).




对于讲德语的英语学生来说最令人费解的一句话

就是这个词:最终。在德语中有一个非常相似的词:eventuell,

这意味着:也许。但最终意味着:终于


-

Karl Heinz Buchegger
kb ****** @ gascad.at


Bob Hairgrove写道:
Bob Hairgrove wrote:
你必须实现某种查找表或字典。

虽然STL支持语言环境,但我认为没有办法比较*不同*语言环境中的两个字符串...特别是对于
Unicode字符串,因为没有Unicode的语言环境 - Unicode
涵盖* all * locales。


这是我怀疑的。非常感谢。现在,我想知道这个

字典是否已经实现了?

此外,有很多单词表示一种语言中的一种(或
语言环境)还有其他不同语言的东西,虽然它们是
You have to implement some kind of lookup table or dictionary.

Although STL supports locales, I don''t think there is a way of
comparing two strings in *different* locales ... especially for
Unicode strings, since there is no locale for Unicode -- Unicode
covers *all* locales.
This is what I suspected. Many thanks for that. Now, I wonder if such a
dictionary has already been implemented?
Also, there are many words which mean one thing in one language (or
locale) and something else in a different language, although they are




这不是一个问题,因为我正在处理的字符串是

地理元素 - 地名等我已经处理了本地化版本

这些(例如Koln和Cologne相当)它基本上只是一个

重音问题。


非常感谢,


Andrew



This won''t really be a problem because the strings I''m dealing with are
geographical elements - placenames etc. I''ve dealt with localised versions
of these (eg Koln and Cologne are equivalent) it''s essentially just a
problem with accents.

Many thanks,

Andrew


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

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