[Mono-dev] Error Normalizing Arabic Strings

Tom Philpot tom.philpot at logos.com
Fri Sep 11 18:36:46 EDT 2009


I just discovered more Unicode Normalization Bugs in Mono SVN.


using System;
using System.Text;

namespace Test
{

    public class NormalizationTest_Arabic {

        public void TestNormalization() {
            char[] originalChars = new char [] { '\u064A', '\u064F',
'\u0648', '\u0654', '\u0652', '\u064A', '\u064F', '\u0648', '\u0654' };

            // Results from http://minaret.info/test/normalize.msp
            char[] formC = new char [] { '\u064A', '\u064F', '\u0624',
'\u0652', '\u064a', '\u064f', '\u0624' };
            char[] formD = new char [] { '\u064A', '\u064F', '\u0648',
'\u0652', '\u0654', '\u064a', '\u064f', '\u0648', '\u0654' };
            char[] formKC = new char [] { '\u064A', '\u064F', '\u0624',
'\u0652', '\u064a', '\u064f', '\u0624' };
            char[] formKD = new char [] { '\u064A', '\u064F', '\u0648',
'\u0652', '\u0654', '\u064a', '\u064f', '\u0648', '\u0654' };
                   
            string str = new string(originalChars);
        
            string strNormalizedC = str.Normalize(NormalizationForm.FormC);
            string strNormalizedD = str.Normalize(NormalizationForm.FormD);
            string strNormalizedKC =
str.Normalize(NormalizationForm.FormKC);
            string strNormalizedKD =
str.Normalize(NormalizationForm.FormKD);
        }
    
        public static void Main()
        {
            NormalizationTest_Arabic nta = new NormalizationTest_Arabic();
            nta.TestNormalization();
        }
    }



More information about the Mono-devel-list mailing list