Implement Marshal.GenerateProgIdForType
[mono.git] / mcs / class / I18N / MidEast / CP38598.cs
index c0b8e4de9d7beae05393d187e3414ebc659bcef9..3590d59aef18f9c0dbd3a844fa34b698251e40ea 100644 (file)
@@ -28,8 +28,10 @@ namespace I18N.MidEast
 {
 
 using System;
+using System.Text;
 using I18N.Common;
 
+[Serializable]
 public class CP38598 : ByteEncoding
 {
        public CP38598()
@@ -84,10 +86,15 @@ public class CP38598 : ByteEncoding
                '\u003F', '\u003F', '\u003F', '\u003F', 
        };
 
-       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++]);
@@ -158,15 +165,21 @@ public class CP38598 : 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)
        {
@@ -249,9 +262,11 @@ public class CP38598 : ByteEncoding
                        --charCount;
                }
        }
+       */
 
 }; // class CP38598
 
+[Serializable]
 public class ENCwindows_38598 : CP38598
 {
        public ENCwindows_38598() : base() {}