为什么" SS"等于德锐的性格'SS'? [英] Why is "ss" equal to the German sharp-s character 'ß'?

查看:232
本文介绍了为什么" SS"等于德锐的性格'SS'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来到这个问题我不知道为什么 A AE 是不同的(这是有道理的),但 SS SS 视为相等。我还没有找到一个答案所以即使<一href="http://stackoverflow.com/questions/44288/differences-in-string-compare-methods-in-c-sharp">this问题似乎是相关的,甚至提到的 SS 将相当于 SS 的德国,或类似的,但不知其所以然。

我发现MSDN上的唯一资源是这样的:如何:比较字符串

下面提及以下,而且缺乏的为什么的:

  //他们跳舞在大街上。
//在语言(在Windows),SS等于
//德国essetz:'SS'在这两个EN-US和去DE的文化性格。
.....
 

那么,为什么这个计算结果为,都与去DE 文化或其他文化:

 变种CI =新的CultureInfo(去DE);
INT结果= ci.CompareInfo.Compare(大街,大街,CompareOptions.IgnoreNonSpace); // 0
布尔等于= String.Equals(大街,大街,StringComparison.CurrentCulture); // 真正
等于= String.Equals(大街,大街,StringComparison.InvariantCulture); // 真正
 

解决方案

如果你看一下Ä页面中,你会发现并不总是一个是一个替代自动曝光(AE或),而且还在各种语言的使用。

SS 来代替:

  

虽然字母SS已在其他语言中使用,现在仅用于德国。但是,它不是在瑞士,列支敦士登和纳米比亚使用。[1]在德国,奥地利,比利时讲德语,[2]丹麦,[3]卢森堡[4]和南蒂罗尔,意大利[5]遵循的标准规则SS

因此​​,SS采用的是一个单一的语言,用一个单一的规则(SS = = SS),而A采用的是多语言,多条规则。

需要注意的是,考虑到情况下折叠是:

  

案例折叠主要用于文本的无壳的比较,诸如在计算机程序中的标识符,而不是实际的文本变换

该负责人统一code 7.0 案例耐折性能告诉我们,

  

00DF; F; 0073 0073; #拉丁小写字母声s

其中,00DF是SS和0073是S,所以SS可以考虑的,对于无壳比较,因为SS。

Coming from this question I'm wondering why ä and ae are different(which makes sense) but ß and ss are treated as equal. I haven't found an answer on SO even if this question seems to be related and even mentions "that ß will compare equal to SS in Germany, or similar" but not why.

The only resource on MSDN I found was this: How to: Compare Strings

Here is mentioned following but also lacks the why:

// "They dance in the street." 
// Linguistically (in Windows), "ss" is equal to 
// the German essetz: 'ß' character in both en-US and de-DE cultures. 
.....

So why does this evaluate to true, both with de-DE culture or any other culture:

var ci = new CultureInfo("de-DE");
int result = ci.CompareInfo.Compare("strasse", "straße", CompareOptions.IgnoreNonSpace); // 0
bool equals = String.Equals("strasse", "straße", StringComparison.CurrentCulture); // true
equals = String.Equals("strasse", "straße", StringComparison.InvariantCulture);  // true

解决方案

If you look at the Ä page, you'll see that not always Ä is a replacement for Æ (or ae), and it is still used in various languages.

The letter ß instead:

While the letter "ß" has been used in other languages, it is now only used in German. However, it is not used in Switzerland, Liechtenstein or Namibia.[1] German speakers in Germany, Austria, Belgium,[2] Denmark,[3] Luxembourg[4] and South Tyrol, Italy[5] follow the standard rules for ß.

So the ß is used in a single language, with a single rule (ß == ss), while the Ä is used in multiple languages with multiple rules.

Note that, considering that case folding is:

Case folding is primarily used for caseless comparison of text, such as identifiers in a computer program, rather than actual text transformation

The official Unicode 7.0 Case Folding Properties tells us that

00DF; F; 0073 0073; # LATIN SMALL LETTER SHARP S

where 00DF is ß and 0073 is s, so ß can be considered, for caseless comparison, as ss.

这篇关于为什么&QUOT; SS&QUOT;等于德锐的性格'SS'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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