Fix several issues in the code generator
[mono.git] / mcs / class / I18N / West / CP28597.cs
index b4a25378f03bae7eb333540af964fb476d68c8a7..9a99c0c78a1f1f23ef38117a4e4f554082f4f1a7 100644 (file)
@@ -28,8 +28,10 @@ namespace I18N.West
 {
 
 using System;
+using System.Text;
 using I18N.Common;
 
+[Serializable]
 public class CP28597 : ByteEncoding
 {
        public CP28597()
@@ -84,10 +86,15 @@ public class CP28597 : ByteEncoding
                '\u03CC', '\u03CD', '\u03CE', '\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++]);
@@ -197,15 +204,21 @@ public class CP28597 : 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)
        {
@@ -327,9 +340,11 @@ public class CP28597 : ByteEncoding
                        --charCount;
                }
        }
+       */
 
 }; // class CP28597
 
+[Serializable]
 public class ENCiso_8859_7 : CP28597
 {
        public ENCiso_8859_7() : base() {}