New test.
[mono.git] / mcs / class / I18N / West / CP28593.cs
index 93f93e494de4cd27bcda3dee40a4c8971e906170..4ff26628f94d2b3b0ad4af0e3424be5af7abc044 100644 (file)
@@ -28,8 +28,10 @@ namespace I18N.West
 {
 
 using System;
+using System.Text;
 using I18N.Common;
 
+[Serializable]
 public class CP28593 : ByteEncoding
 {
        public CP28593()
@@ -84,10 +86,15 @@ public class CP28593 : ByteEncoding
                '\u00FC', '\u016D', '\u015D', '\u02D9', 
        };
 
-       protected override void ToBytes(char[] chars, int charIndex, int charCount,
-                                       byte[] bytes, int byteIndex)
+       protected unsafe override void ToBytes(char* chars, int charCount,
+                                       byte* bytes, int byteCount)
        {
                int ch;
+               int charIndex = 0;
+               int byteIndex = 0;
+#if NET_2_0
+               EncoderFallbackBuffer buffer = null;
+#endif
                while(charCount > 0)
                {
                        ch = (int)(chars[charIndex++]);
@@ -187,15 +194,21 @@ public class CP28593 : ByteEncoding
                                        if(ch >= 0xFF01 && ch <= 0xFF5E)
                                                ch -= 0xFEE0;
                                        else
+#if NET_2_0
+                                               HandleFallback (ref buffer, chars, ref charIndex, ref charCount, bytes, ref byteIndex, ref byteCount);
+#else
                                                ch = 0x3F;
+#endif
                                }
                                break;
                        }
                        bytes[byteIndex++] = (byte)ch;
                        --charCount;
+                       --byteCount;
                }
        }
 
+       /*
        protected override void ToBytes(String s, int charIndex, int charCount,
                                        byte[] bytes, int byteIndex)
        {
@@ -307,9 +320,11 @@ public class CP28593 : ByteEncoding
                        --charCount;
                }
        }
+       */
 
 }; // class CP28593
 
+[Serializable]
 public class ENCiso_8859_3 : CP28593
 {
        public ENCiso_8859_3() : base() {}