Char ... Unicode版本(bug?):2.0怎么样? [英] Char... Unicode version (bug?): what about 2.0?
问题描述
大家好,我想提交看起来似乎是一个bug的问题,比如像Char.Is这样的方法符合Unicode
:如最新版本所述
Unicode,代码+ 03F2和+ 03F9分别代表希腊语月文sigma,小写和
大写(c和C)。对于这些代码,我得到以下
结果:
+ 03F2:小写c:
Char.IsLetter()= true (好的)
Char.IsUpper()= false(OK)
Char.IsLower()= true(OK)
Char.ToUpper (''\ x3f2'')和.ToLower都= + 03F2(!我希望+ 03F9为
ToUpper)
+ 03F9 :大写C:
Char.IsLetter()= false(!)
Char.IsUpper()= false(!)
Char。 IsLower()= false(OK)
Char.ToUpper(''\ x3f9'')和.ToLower都= + 03F9(!我希望+ 03F2为
ToLower)
看来+ 03F9不被视为''字母'',因为它发生在+ 03F2,
似乎被剥夺了其资本形式。我想知道这是一个来自旧版Unicode版本的
问题,还是只是一个bug或某些
设计选择我可以'没问题,如果有人使用.NET 2 Beta可以告诉我
.NET 2.0如何处理这个问题。
如果你的2.0家伙和我一样懒,尝试使用以下代码片段进行
测试(只需将其粘贴到控制台应用程序中):
static private void DumpSingleChar(char c)
{
Console.WriteLine(" IsLetter = {0}",Char.IsLetter(c));
Console.WriteLine(" IsUpper = {0}",Char.IsUpper(c));
Console.WriteLine(" IsLower = {0}",Char.IsLower(c));
Console.WriteLine(" ToUpper = {0:X4}",(int)Char.ToUpper(c));
Console.WriteLine(" ToLower = {0: X4}",(int)Char.ToLower(c));
}
[STAThread]
static void Main(string [] args)
{
Console.WriteLine(" +0 3F2");
DumpSingleChar(''\ x3F2'');
Console.WriteLine(" + 03F9");
DumpSingleChar(''\ x3F9'');
}
Thanx!
Hi all, I''d like to submit what it seems to be a bug as for the Unicode
compliance of methods like Char.Is...: as stated by the latest version of
Unicode, codes +03F2 and +03F9 represent Greek lunate sigma, lowercase and
uppercase respectively (c and C). For these codes I get the following
results:
+03F2: lowercase c:
Char.IsLetter() = true (OK)
Char.IsUpper() = false (OK)
Char.IsLower() = true (OK)
Char.ToUpper(''\x3f2'') and .ToLower both = +03F2 (! I''d expect +03F9 for
ToUpper)
+03F9: uppercase C:
Char.IsLetter() = false (!)
Char.IsUpper() = false (!)
Char.IsLower() = false (OK)
Char.ToUpper(''\x3f9'') and .ToLower both = +03F9 (! I''d expect +03F2 for
ToLower)
It appears that +03F9 is not treated as a ''letter'' as it happens for +03F2,
which seems deprived of its capital form. I''d like to know if this is an
issue coming from an older Unicode version or it''s just a bug or by some
design choice I can''t catch, and if anyone using the .NET 2 Beta can tell me
how .NET 2.0 behaves about this.
If you 2.0 guys are as lazy as me, try the following code fragment to have a
test (just paste it into a console app):
static private void DumpSingleChar(char c)
{
Console.WriteLine("IsLetter = {0}", Char.IsLetter(c));
Console.WriteLine("IsUpper = {0}", Char.IsUpper(c));
Console.WriteLine("IsLower = {0}", Char.IsLower(c));
Console.WriteLine("ToUpper = {0:X4}", (int)Char.ToUpper(c));
Console.WriteLine("ToLower = {0:X4}", (int)Char.ToLower(c));
}
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("+03F2");
DumpSingleChar(''\x3F2'');
Console.WriteLine("+03F9");
DumpSingleChar(''\x3F9'');
}
Thanx!
推荐答案
嗨Dan,
我担心.NET Framework 1.1使用的unicode版本甚至2.0版本都不支持资本月度sigma 。据我所知,.NET Framework 1.1使用的是Unicode版本3.1,并且2.0中的行为相同。
http://www.tlg.uci.edu/help/UnicodeTest.html
- < br $>
快乐的编码!
Morten Wennevik [C#MVP]
Hi Dan,
I''m afraid the capital lunate sigma is not supported in the unicode version used by .NET Framework 1.1 and perhaps even 2.0. As far as I can tell Unicode version 3.1 is used by .NET Framework 1.1, and the behaviour is the same in 2.0.
http://www.tlg.uci.edu/help/UnicodeTest.html
--
Happy coding!
Morten Wennevik [C# MVP]
嗨丹,
我担心.NET Framework 1.1使用的unicode版本甚至2.0版本都不支持资本月度sigma。据我所知,.NET Framework 1.1使用的是Unicode版本3.1,并且2.0中的行为相同。
http://www.tlg.uci.edu/help/UnicodeTest.html
- < br $>
快乐的编码!
Morten Wennevik [C#MVP]
Hi Dan,
I''m afraid the capital lunate sigma is not supported in the unicode version used by .NET Framework 1.1 and perhaps even 2.0. As far as I can tell Unicode version 3.1 is used by .NET Framework 1.1, and the behaviour is the same in 2.0.
http://www.tlg.uci.edu/help/UnicodeTest.html
--
Happy coding!
Morten Wennevik [C# MVP]
2005年8月23日星期二18:01:58 +0200,丹 < fu ********** @ tiscali.it>
写道:
On Tue, 23 Aug 2005 18:01:58 +0200, "Dan" <fu**********@tiscali.it>
wrote:
大家好,我想提交对于像Char.Is这样的方法的Unicode符合性似乎是一个错误......:如最新版本的
Unicode所述,代码+ 03F2和+ 03F9代表希腊语月文sigma,分别为小写和
大写(c和C)。
Hi all, I''d like to submit what it seems to be a bug as for the Unicode
compliance of methods like Char.Is...: as stated by the latest version of
Unicode, codes +03F2 and +03F9 represent Greek lunate sigma, lowercase and
uppercase respectively (c and C).
如果这是一个可重现的错误,你一定要把它提交给
MSDN产品反馈中心:
http://lab.msdn.microsoft .com / productfeedback /
我不认为VS 2005会修复任何新错误但是微软
可能会修复它服务包或更高版本。
-
http: //www.kynosarges.de
这篇关于Char ... Unicode版本(bug?):2.0怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!