When running the attached test.cs I get this:

[toor@~]$ mono test.exe 

** ERROR **: file unicode.c: line 390 (iconv_convert): should not be
reached
aborting...
Aborted

I use mono-0.11_baselabs-20020513 rpms.

What is wrong here? Anyone?
Same type of error occurs in the cygwin environment.

/Richard
using System;
using System.Globalization;

namespace ConsoleApplication2
{
        public class testing
        {       

                public void testFrom64()
                {
                        char[] charArr = {'a','s','d','f'};
                        string str = "rlp7QA==";
                        
                        byte[] fromCharArr = Convert.FromBase64CharArray(charArr, 0, 
4);
                        byte[] fromStr = Convert.FromBase64String(str);                
 

                        for(int i = 0; i < fromCharArr.GetLength(0); i++)
                                Console.Write((char)fromCharArr[i]+" ");
                        Console.WriteLine();

                        for(int i = 0; i < fromStr.GetLength(0); i++) 
                                Console.Write(fromStr[i]+" ");
                        Console.WriteLine();
                }

                public void testTo64(){

                        byte[] toCharArr = {174,90,123,64};
                        char[] outCharArr = new Char[8];                        
                        int kalle = 0;

                        try {kalle = 
Convert.ToBase64CharArray(toCharArr,0,4,outCharArr,0);}
                        catch (Exception e) {Console.WriteLine("Error occured");}

                        for(int i = 0; i < toCharArr.GetLength(0); i++) 
                                Console.Write(toCharArr[i]+" ");
                        Console.WriteLine();
                        
                        for(int i = 0; i < outCharArr.GetLength(0); i++) 
                                Console.Write(outCharArr[i]+" ");
                        Console.WriteLine("\n"+kalle);

                        string berit = Convert.ToBase64String(toCharArr);

                        Console.WriteLine(berit);       
                        
                }               
        }       

        public class kribbe
        {
                public static void Main(string[] args)
                {
                        testing t = new testing();
                        t.testFrom64();
                        t.testTo64();
                        Console.ReadLine();
                }

        }
}

Reply via email to