[Mono-dev] Unhandled Exception in Normalization.cs Combine()
Atsushi Eno
atsushieno at veritas-vos-liberabit.com
Mon Jun 15 04:58:40 EDT 2009
Hi again,
It should be now fixed in trunk.
Atsushi Eno
Atsushi Eno wrote:
> I'll have a look. However since 4 years have passed since I wrote it,
> I'll have to revisit the spec and will take not a little time.
>
> Atsushi Eno
>
> Tom Philpot wrote:
>> The following program throws an UnhandledException when trying to
>> normalize a series of greek characters. I’ve tested this with Mono 2.4.7
>> and the latest code from SVN as of about 1 week ago.
>> The same program works fine under Visual Studio.
>>
>> I’m new to Unicode, but I thought I’d put this out there to see if
>> anyone had a quick fix.
>>
>> using System;
>> using System.Text;
>>
>> namespace NormalizationTest
>> {
>> class Program
>> {
>> static void Main(string[] args)
>> {
>> byte[] utf8Bytes = new byte[] {0xCE, 0xB1, 0xCC, 0x93, 0xCD,
>> 0x85};
>> string strToNormalize =
>> System.Text.Encoding.UTF8.GetString(utf8Bytes);
>> Console.WriteLine("Converted from Hex: {0}", strToNormalize);
>>
>> Console.WriteLine("Composed Normalized String:
>> IsNormalized(NormalizationForm.FormC) = {0}",
>> strToNormalize.IsNormalized(NormalizationForm.FormC));
>> Console.WriteLine("{0}",
>> strToNormalize.Normalize(NormalizationForm.FormC));
>> }
>> }
>> }
>>
>> ---- Output ---
>> WS1048:Debug tom.philpot$ /opt/mono/bin/gmcs NormTest.cs
>> /out:NormTest.exe && /opt/mono/bin/mono --debug NormTest.exe
>> Converted from Hex: ᾀ
>> Composed Normalized String: IsNormalized(NormalizationForm.FormC) = False
>>
>> Unhandled Exception: System.SystemException: Internal error: should not
>> happen.
>> at Mono.Globalization.Unicode.Normalization.Combine
>> (System.Text.StringBuilder sb, Int32 start, Int32 checkType) [0x00198]
>> in
>> /Users/tom.philpot/External/mono-project/mcs/class/corlib/Mono.Globalization.Unicode/Normalization.cs:206
>>
>> at Mono.Globalization.Unicode.Normalization.Combine (System.String
>> source, Int32 start, Int32 checkType) [0x0003c] in
>> /Users/tom.philpot/External/mono-project/mcs/class/corlib/Mono.Globalization.Unicode/Normalization.cs:135
>>
>> at Mono.Globalization.Unicode.Normalization.Compose (System.String
>> source, Int32 checkType) [0x00011] in
>> /Users/tom.philpot/External/mono-project/mcs/class/corlib/Mono.Globalization.Unicode/Normalization.cs:121
>>
>> at Mono.Globalization.Unicode.Normalization.Normalize (System.String
>> source, Int32 type) [0x00015] in
>> /Users/tom.philpot/External/mono-project/mcs/class/corlib/Mono.Globalization.Unicode/Normalization.cs:392
>>
>> at System.String.Normalize (NormalizationForm normalizationForm)
>> [0x00023] in
>> /Users/tom.philpot/External/mono-project/mcs/class/corlib/System/String.cs:1442
>>
>> at NormalizationTest.Program.Main (System.String[] args) [0x00000]
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list