X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FI18N%2FOther%2FCP874.cs;h=1f08062fbb4c9023b705f4d0a2574e09c95804cf;hb=2392c6a50d5640aefa3c0f9e68fb261b4f06076e;hp=97b41aa29d848be4c25a82ec0a5619744e7c115e;hpb=234225d112c4b018b8d1796f4c06a15812137500;p=mono.git diff --git a/mcs/class/I18N/Other/CP874.cs b/mcs/class/I18N/Other/CP874.cs index 97b41aa29d8..1f08062fbb4 100644 --- a/mcs/class/I18N/Other/CP874.cs +++ b/mcs/class/I18N/Other/CP874.cs @@ -28,8 +28,10 @@ namespace I18N.Other { using System; +using System.Text; using I18N.Common; +[Serializable] public class CP874 : ByteEncoding { public CP874() @@ -84,10 +86,15 @@ public class CP874 : ByteEncoding '\u00A2', '\u00AC', '\u00A6', '\u00A0', }; - 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++]); @@ -296,15 +303,21 @@ public class CP874 : 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) { @@ -525,9 +538,11 @@ public class CP874 : ByteEncoding --charCount; } } + */ }; // class CP874 +[Serializable] public class ENCwindows_874 : CP874 { public ENCwindows_874() : base() {}