diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2017-10-16 14:22:39 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2017-10-17 15:12:24 +0300 |
commit | 4c4d3dcdc52541360cebe367901cff2598a81692 (patch) | |
tree | bd2a095f2dfffdd4903bf350cf6482b63a67784b /mcs | |
parent | 73eed5d415f994cff80d8e7c0a2444c5c4113dfb (diff) |
[I18N] Remove commented code from ucm2cp.c
This is just confusing in the final output.
Diffstat (limited to 'mcs')
69 files changed, 205 insertions, 20576 deletions
diff --git a/mcs/class/I18N/MidEast/CP1254.cs b/mcs/class/I18N/MidEast/CP1254.cs index 52bf98f438f..e8c21e614c0 100644 --- a/mcs/class/I18N/MidEast/CP1254.cs +++ b/mcs/class/I18N/MidEast/CP1254.cs @@ -97,12 +97,11 @@ public class CP1254 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1254 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1254 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -301,165 +300,6 @@ public class CP1254 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x0081: - case 0x008D: - case 0x008E: - case 0x008F: - case 0x0090: - case 0x009D: - case 0x009E: - case 0x00A0: - case 0x00A1: - case 0x00A2: - case 0x00A3: - case 0x00A4: - case 0x00A5: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AA: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00AF: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00B8: - case 0x00B9: - case 0x00BA: - case 0x00BB: - case 0x00BC: - case 0x00BD: - case 0x00BE: - case 0x00BF: - case 0x00C0: - case 0x00C1: - case 0x00C2: - case 0x00C3: - case 0x00C4: - case 0x00C5: - case 0x00C6: - case 0x00C7: - case 0x00C8: - case 0x00C9: - case 0x00CA: - case 0x00CB: - case 0x00CC: - case 0x00CD: - case 0x00CE: - case 0x00CF: - case 0x00D1: - case 0x00D2: - case 0x00D3: - case 0x00D4: - case 0x00D5: - case 0x00D6: - case 0x00D7: - case 0x00D8: - case 0x00D9: - case 0x00DA: - case 0x00DB: - case 0x00DC: - case 0x00DF: - case 0x00E0: - case 0x00E1: - case 0x00E2: - case 0x00E3: - case 0x00E4: - case 0x00E5: - case 0x00E6: - case 0x00E7: - case 0x00E8: - case 0x00E9: - case 0x00EA: - case 0x00EB: - case 0x00EC: - case 0x00ED: - case 0x00EE: - case 0x00EF: - case 0x00F1: - case 0x00F2: - case 0x00F3: - case 0x00F4: - case 0x00F5: - case 0x00F6: - case 0x00F7: - case 0x00F8: - case 0x00F9: - case 0x00FA: - case 0x00FB: - case 0x00FC: - case 0x00FF: - break; - case 0x011E: ch = 0xD0; break; - case 0x011F: ch = 0xF0; break; - case 0x0130: ch = 0xDD; break; - case 0x0131: ch = 0xFD; break; - case 0x0152: ch = 0x8C; break; - case 0x0153: ch = 0x9C; break; - case 0x015E: ch = 0xDE; break; - case 0x015F: ch = 0xFE; break; - case 0x0160: ch = 0x8A; break; - case 0x0161: ch = 0x9A; break; - case 0x0178: ch = 0x9F; break; - case 0x0192: ch = 0x83; break; - case 0x02C6: ch = 0x88; break; - case 0x02DC: ch = 0x98; break; - case 0x2013: ch = 0x96; break; - case 0x2014: ch = 0x97; break; - case 0x2018: ch = 0x91; break; - case 0x2019: ch = 0x92; break; - case 0x201A: ch = 0x82; break; - case 0x201C: ch = 0x93; break; - case 0x201D: ch = 0x94; break; - case 0x201E: ch = 0x84; break; - case 0x2020: ch = 0x86; break; - case 0x2021: ch = 0x87; break; - case 0x2022: ch = 0x95; break; - case 0x2026: ch = 0x85; break; - case 0x2030: ch = 0x89; break; - case 0x2039: ch = 0x8B; break; - case 0x203A: ch = 0x9B; break; - case 0x20AC: ch = 0x80; break; - case 0x2122: ch = 0x99; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1254 [Serializable] diff --git a/mcs/class/I18N/MidEast/CP1255.cs b/mcs/class/I18N/MidEast/CP1255.cs index d2faf6d1644..7a765169669 100644 --- a/mcs/class/I18N/MidEast/CP1255.cs +++ b/mcs/class/I18N/MidEast/CP1255.cs @@ -97,12 +97,11 @@ public class CP1255 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1255 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1255 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -298,162 +297,6 @@ public class CP1255 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x0081: - case 0x008A: - case 0x008C: - case 0x008D: - case 0x008E: - case 0x008F: - case 0x0090: - case 0x009A: - case 0x009C: - case 0x009D: - case 0x009E: - case 0x009F: - case 0x00A0: - case 0x00A1: - case 0x00A2: - case 0x00A3: - case 0x00A5: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00AF: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00B8: - case 0x00B9: - case 0x00BB: - case 0x00BC: - case 0x00BD: - case 0x00BE: - case 0x00BF: - break; - case 0x00D7: ch = 0xAA; break; - case 0x00F7: ch = 0xBA; break; - case 0x0192: ch = 0x83; break; - case 0x02C6: ch = 0x88; break; - case 0x02DC: ch = 0x98; break; - case 0x05B0: - case 0x05B1: - case 0x05B2: - case 0x05B3: - case 0x05B4: - case 0x05B5: - case 0x05B6: - case 0x05B7: - case 0x05B8: - case 0x05B9: - ch -= 0x04F0; - break; - case 0x05BB: - case 0x05BC: - case 0x05BD: - case 0x05BE: - case 0x05BF: - case 0x05C0: - case 0x05C1: - case 0x05C2: - case 0x05C3: - ch -= 0x04F0; - break; - case 0x05D0: - case 0x05D1: - case 0x05D2: - case 0x05D3: - case 0x05D4: - case 0x05D5: - case 0x05D6: - case 0x05D7: - case 0x05D8: - case 0x05D9: - case 0x05DA: - case 0x05DB: - case 0x05DC: - case 0x05DD: - case 0x05DE: - case 0x05DF: - case 0x05E0: - case 0x05E1: - case 0x05E2: - case 0x05E3: - case 0x05E4: - case 0x05E5: - case 0x05E6: - case 0x05E7: - case 0x05E8: - case 0x05E9: - case 0x05EA: - ch -= 0x04F0; - break; - case 0x05F0: - case 0x05F1: - case 0x05F2: - case 0x05F3: - case 0x05F4: - ch -= 0x051C; - break; - case 0x200E: ch = 0xFD; break; - case 0x200F: ch = 0xFE; break; - case 0x2013: ch = 0x96; break; - case 0x2014: ch = 0x97; break; - case 0x2018: ch = 0x91; break; - case 0x2019: ch = 0x92; break; - case 0x201A: ch = 0x82; break; - case 0x201C: ch = 0x93; break; - case 0x201D: ch = 0x94; break; - case 0x201E: ch = 0x84; break; - case 0x2020: ch = 0x86; break; - case 0x2021: ch = 0x87; break; - case 0x2022: ch = 0x95; break; - case 0x2026: ch = 0x85; break; - case 0x2030: ch = 0x89; break; - case 0x2039: ch = 0x8B; break; - case 0x203A: ch = 0x9B; break; - case 0x20AA: ch = 0xA4; break; - case 0x20AC: ch = 0x80; break; - case 0x2122: ch = 0x99; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1255 [Serializable] diff --git a/mcs/class/I18N/MidEast/CP1256.cs b/mcs/class/I18N/MidEast/CP1256.cs index 430c68d8dfc..b61f5b78b80 100644 --- a/mcs/class/I18N/MidEast/CP1256.cs +++ b/mcs/class/I18N/MidEast/CP1256.cs @@ -97,12 +97,11 @@ public class CP1256 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1256 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1256 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -487,351 +486,6 @@ public class CP1256 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x00A0: - case 0x00A2: - case 0x00A3: - case 0x00A4: - case 0x00A5: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00AF: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00B8: - case 0x00B9: - case 0x00BB: - case 0x00BC: - case 0x00BD: - case 0x00BE: - case 0x00D7: - case 0x00E0: - case 0x00E2: - case 0x00E7: - case 0x00E8: - case 0x00E9: - case 0x00EA: - case 0x00EB: - case 0x00EE: - case 0x00EF: - case 0x00F4: - case 0x00F7: - case 0x00F9: - case 0x00FB: - case 0x00FC: - break; - case 0x0152: ch = 0x8C; break; - case 0x0153: ch = 0x9C; break; - case 0x0192: ch = 0x83; break; - case 0x02C6: ch = 0x88; break; - case 0x060C: ch = 0xA1; break; - case 0x061B: ch = 0xBA; break; - case 0x061F: ch = 0xBF; break; - case 0x0621: - case 0x0622: - case 0x0623: - case 0x0624: - case 0x0625: - case 0x0626: - case 0x0627: - case 0x0628: - case 0x0629: - case 0x062A: - case 0x062B: - case 0x062C: - case 0x062D: - case 0x062E: - case 0x062F: - case 0x0630: - case 0x0631: - case 0x0632: - case 0x0633: - case 0x0634: - case 0x0635: - case 0x0636: - ch -= 0x0560; - break; - case 0x0637: - case 0x0638: - case 0x0639: - case 0x063A: - ch -= 0x055F; - break; - case 0x0640: - case 0x0641: - case 0x0642: - case 0x0643: - ch -= 0x0564; - break; - case 0x0644: ch = 0xE1; break; - case 0x0645: - case 0x0646: - case 0x0647: - case 0x0648: - ch -= 0x0562; - break; - case 0x0649: ch = 0xEC; break; - case 0x064A: ch = 0xED; break; - case 0x064B: - case 0x064C: - case 0x064D: - case 0x064E: - ch -= 0x055B; - break; - case 0x064F: ch = 0xF5; break; - case 0x0650: ch = 0xF6; break; - case 0x0651: ch = 0xF8; break; - case 0x0652: ch = 0xFA; break; - case 0x0660: - case 0x0661: - case 0x0662: - case 0x0663: - case 0x0664: - case 0x0665: - case 0x0666: - case 0x0667: - case 0x0668: - case 0x0669: - ch -= 0x0630; - break; - case 0x066B: ch = 0x2C; break; - case 0x066C: ch = 0x2E; break; - case 0x0679: ch = 0x8A; break; - case 0x067E: ch = 0x81; break; - case 0x0686: ch = 0x8D; break; - case 0x0688: ch = 0x8F; break; - case 0x0691: ch = 0x9A; break; - case 0x0698: ch = 0x8E; break; - case 0x06A9: ch = 0x98; break; - case 0x06AF: ch = 0x90; break; - case 0x06BA: ch = 0x9F; break; - case 0x06BE: ch = 0xAA; break; - case 0x06C1: ch = 0xC0; break; - case 0x06D2: ch = 0xFF; break; - case 0x06F0: - case 0x06F1: - case 0x06F2: - case 0x06F3: - case 0x06F4: - case 0x06F5: - case 0x06F6: - case 0x06F7: - case 0x06F8: - case 0x06F9: - ch -= 0x06C0; - break; - case 0x200C: ch = 0x9D; break; - case 0x200D: ch = 0x9E; break; - case 0x200E: ch = 0xFD; break; - case 0x200F: ch = 0xFE; break; - case 0x2013: ch = 0x96; break; - case 0x2014: ch = 0x97; break; - case 0x2018: ch = 0x91; break; - case 0x2019: ch = 0x92; break; - case 0x201A: ch = 0x82; break; - case 0x201C: ch = 0x93; break; - case 0x201D: ch = 0x94; break; - case 0x201E: ch = 0x84; break; - case 0x2020: ch = 0x86; break; - case 0x2021: ch = 0x87; break; - case 0x2022: ch = 0x95; break; - case 0x2026: ch = 0x85; break; - case 0x2030: ch = 0x89; break; - case 0x2039: ch = 0x8B; break; - case 0x203A: ch = 0x9B; break; - case 0x20AC: ch = 0x80; break; - case 0x2122: ch = 0x99; break; - case 0xFB56: ch = 0x81; break; - case 0xFB58: ch = 0x81; break; - case 0xFB66: ch = 0x8A; break; - case 0xFB68: ch = 0x8A; break; - case 0xFB7A: ch = 0x8D; break; - case 0xFB7C: ch = 0x8D; break; - case 0xFB88: ch = 0x8F; break; - case 0xFB8A: ch = 0x8E; break; - case 0xFB8C: ch = 0x9A; break; - case 0xFB8E: ch = 0x98; break; - case 0xFB90: ch = 0x98; break; - case 0xFB92: ch = 0x90; break; - case 0xFB94: ch = 0x90; break; - case 0xFB9E: ch = 0x9F; break; - case 0xFBA6: ch = 0xC0; break; - case 0xFBA8: ch = 0xC0; break; - case 0xFBAA: ch = 0xAA; break; - case 0xFBAC: ch = 0xAA; break; - case 0xFBAE: ch = 0xFF; break; - case 0xFE70: ch = 0xF0; break; - case 0xFE71: ch = 0xF0; break; - case 0xFE72: ch = 0xF1; break; - case 0xFE74: ch = 0xF2; break; - case 0xFE76: ch = 0xF3; break; - case 0xFE77: ch = 0xF3; break; - case 0xFE78: ch = 0xF5; break; - case 0xFE79: ch = 0xF5; break; - case 0xFE7A: ch = 0xF6; break; - case 0xFE7B: ch = 0xF6; break; - case 0xFE7C: ch = 0xF8; break; - case 0xFE7D: ch = 0xF8; break; - case 0xFE7E: ch = 0xFA; break; - case 0xFE7F: ch = 0xFA; break; - case 0xFE80: ch = 0xC1; break; - case 0xFE81: ch = 0xC2; break; - case 0xFE82: ch = 0xC2; break; - case 0xFE83: ch = 0xC3; break; - case 0xFE84: ch = 0xC3; break; - case 0xFE85: ch = 0xC4; break; - case 0xFE86: ch = 0xC4; break; - case 0xFE87: ch = 0xC5; break; - case 0xFE88: ch = 0xC5; break; - case 0xFE89: ch = 0xC6; break; - case 0xFE8A: ch = 0xC6; break; - case 0xFE8B: ch = 0xC6; break; - case 0xFE8C: ch = 0xC6; break; - case 0xFE8D: ch = 0xC7; break; - case 0xFE8E: ch = 0xC7; break; - case 0xFE8F: ch = 0xC8; break; - case 0xFE90: ch = 0xC8; break; - case 0xFE91: ch = 0xC8; break; - case 0xFE92: ch = 0xC8; break; - case 0xFE93: ch = 0xC9; break; - case 0xFE94: ch = 0xC9; break; - case 0xFE95: ch = 0xCA; break; - case 0xFE96: ch = 0xCA; break; - case 0xFE97: ch = 0xCA; break; - case 0xFE98: ch = 0xCA; break; - case 0xFE99: ch = 0xCB; break; - case 0xFE9A: ch = 0xCB; break; - case 0xFE9B: ch = 0xCB; break; - case 0xFE9C: ch = 0xCB; break; - case 0xFE9D: ch = 0xCC; break; - case 0xFE9E: ch = 0xCC; break; - case 0xFE9F: ch = 0xCC; break; - case 0xFEA0: ch = 0xCC; break; - case 0xFEA1: ch = 0xCD; break; - case 0xFEA2: ch = 0xCD; break; - case 0xFEA3: ch = 0xCD; break; - case 0xFEA4: ch = 0xCD; break; - case 0xFEA5: ch = 0xCE; break; - case 0xFEA6: ch = 0xCE; break; - case 0xFEA7: ch = 0xCE; break; - case 0xFEA8: ch = 0xCE; break; - case 0xFEA9: ch = 0xCF; break; - case 0xFEAA: ch = 0xCF; break; - case 0xFEAB: ch = 0xD0; break; - case 0xFEAC: ch = 0xD0; break; - case 0xFEAD: ch = 0xD1; break; - case 0xFEAE: ch = 0xD1; break; - case 0xFEAF: ch = 0xD2; break; - case 0xFEB0: ch = 0xD2; break; - case 0xFEB1: ch = 0xD3; break; - case 0xFEB2: ch = 0xD3; break; - case 0xFEB3: ch = 0xD3; break; - case 0xFEB4: ch = 0xD3; break; - case 0xFEB5: ch = 0xD4; break; - case 0xFEB6: ch = 0xD4; break; - case 0xFEB7: ch = 0xD4; break; - case 0xFEB8: ch = 0xD4; break; - case 0xFEB9: ch = 0xD5; break; - case 0xFEBA: ch = 0xD5; break; - case 0xFEBB: ch = 0xD5; break; - case 0xFEBC: ch = 0xD5; break; - case 0xFEBD: ch = 0xD6; break; - case 0xFEBE: ch = 0xD6; break; - case 0xFEBF: ch = 0xD6; break; - case 0xFEC0: ch = 0xD6; break; - case 0xFEC1: ch = 0xD8; break; - case 0xFEC2: ch = 0xD8; break; - case 0xFEC3: ch = 0xD8; break; - case 0xFEC4: ch = 0xD8; break; - case 0xFEC5: ch = 0xD9; break; - case 0xFEC6: ch = 0xD9; break; - case 0xFEC7: ch = 0xD9; break; - case 0xFEC8: ch = 0xD9; break; - case 0xFEC9: ch = 0xDA; break; - case 0xFECA: ch = 0xDA; break; - case 0xFECB: ch = 0xDA; break; - case 0xFECC: ch = 0xDA; break; - case 0xFECD: ch = 0xDB; break; - case 0xFECE: ch = 0xDB; break; - case 0xFECF: ch = 0xDB; break; - case 0xFED0: ch = 0xDB; break; - case 0xFED1: ch = 0xDD; break; - case 0xFED2: ch = 0xDD; break; - case 0xFED3: ch = 0xDD; break; - case 0xFED4: ch = 0xDD; break; - case 0xFED5: ch = 0xDE; break; - case 0xFED6: ch = 0xDE; break; - case 0xFED7: ch = 0xDE; break; - case 0xFED8: ch = 0xDE; break; - case 0xFED9: ch = 0xDF; break; - case 0xFEDA: ch = 0xDF; break; - case 0xFEDB: ch = 0xDF; break; - case 0xFEDC: ch = 0xDF; break; - case 0xFEDD: ch = 0xE1; break; - case 0xFEDE: ch = 0xE1; break; - case 0xFEDF: ch = 0xE1; break; - case 0xFEE0: ch = 0xE1; break; - case 0xFEE1: ch = 0xE3; break; - case 0xFEE2: ch = 0xE3; break; - case 0xFEE3: ch = 0xE3; break; - case 0xFEE4: ch = 0xE3; break; - case 0xFEE5: ch = 0xE4; break; - case 0xFEE6: ch = 0xE4; break; - case 0xFEE7: ch = 0xE4; break; - case 0xFEE8: ch = 0xE4; break; - case 0xFEE9: ch = 0xE5; break; - case 0xFEEA: ch = 0xE5; break; - case 0xFEEB: ch = 0xE5; break; - case 0xFEEC: ch = 0xE5; break; - case 0xFEED: ch = 0xE6; break; - case 0xFEEE: ch = 0xE6; break; - case 0xFEEF: ch = 0xEC; break; - case 0xFEF0: ch = 0xEC; break; - case 0xFEF1: ch = 0xED; break; - case 0xFEF2: ch = 0xED; break; - case 0xFEF3: ch = 0xED; break; - case 0xFEF4: ch = 0xED; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1256 [Serializable] diff --git a/mcs/class/I18N/MidEast/CP28596.cs b/mcs/class/I18N/MidEast/CP28596.cs index 145c1f1beef..be2528d1c26 100644 --- a/mcs/class/I18N/MidEast/CP28596.cs +++ b/mcs/class/I18N/MidEast/CP28596.cs @@ -97,12 +97,11 @@ public class CP28596 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP28596 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP28596 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -642,505 +641,6 @@ public class CP28596 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 161) switch(ch) - { - case 0x00A4: - case 0x00AD: - break; - case 0x00A1: ch = 0x21; break; - case 0x00A2: ch = 0x63; break; - case 0x00A5: ch = 0x59; break; - case 0x00A6: ch = 0x7C; break; - case 0x00A9: ch = 0x43; break; - case 0x00AA: ch = 0x61; break; - case 0x00AB: ch = 0x3C; break; - case 0x00AE: ch = 0x52; break; - case 0x00B2: ch = 0x32; break; - case 0x00B3: ch = 0x33; break; - case 0x00B7: ch = 0x2E; break; - case 0x00B8: ch = 0x2C; break; - case 0x00B9: ch = 0x31; break; - case 0x00BA: ch = 0x6F; break; - case 0x00BB: ch = 0x3E; break; - case 0x00C0: ch = 0x41; break; - case 0x00C1: ch = 0x41; break; - case 0x00C2: ch = 0x41; break; - case 0x00C3: ch = 0x41; break; - case 0x00C4: ch = 0x41; break; - case 0x00C5: ch = 0x41; break; - case 0x00C6: ch = 0x41; break; - case 0x00C7: ch = 0x43; break; - case 0x00C8: ch = 0x45; break; - case 0x00C9: ch = 0x45; break; - case 0x00CA: ch = 0x45; break; - case 0x00CB: ch = 0x45; break; - case 0x00CC: ch = 0x49; break; - case 0x00CD: ch = 0x49; break; - case 0x00CE: ch = 0x49; break; - case 0x00CF: ch = 0x49; break; - case 0x00D0: ch = 0x44; break; - case 0x00D1: ch = 0x4E; break; - case 0x00D2: ch = 0x4F; break; - case 0x00D3: ch = 0x4F; break; - case 0x00D4: ch = 0x4F; break; - case 0x00D5: ch = 0x4F; break; - case 0x00D6: ch = 0x4F; break; - case 0x00D8: ch = 0x4F; break; - case 0x00D9: ch = 0x55; break; - case 0x00DA: ch = 0x55; break; - case 0x00DB: ch = 0x55; break; - case 0x00DC: ch = 0x55; break; - case 0x00DD: ch = 0x59; break; - case 0x00E0: ch = 0x61; break; - case 0x00E1: ch = 0x61; break; - case 0x00E2: ch = 0x61; break; - case 0x00E3: ch = 0x61; break; - case 0x00E4: ch = 0x61; break; - case 0x00E5: ch = 0x61; break; - case 0x00E6: ch = 0x61; break; - case 0x00E7: ch = 0x63; break; - case 0x00E8: ch = 0x65; break; - case 0x00E9: ch = 0x65; break; - case 0x00EA: ch = 0x65; break; - case 0x00EB: ch = 0x65; break; - case 0x00EC: ch = 0x69; break; - case 0x00ED: ch = 0x69; break; - case 0x00EE: ch = 0x69; break; - case 0x00EF: ch = 0x69; break; - case 0x00F1: ch = 0x6E; break; - case 0x00F2: ch = 0x6F; break; - case 0x00F3: ch = 0x6F; break; - case 0x00F4: ch = 0x6F; break; - case 0x00F5: ch = 0x6F; break; - case 0x00F6: ch = 0x6F; break; - case 0x00F8: ch = 0x6F; break; - case 0x00F9: ch = 0x75; break; - case 0x00FA: ch = 0x75; break; - case 0x00FB: ch = 0x75; break; - case 0x00FC: ch = 0x75; break; - case 0x00FD: ch = 0x79; break; - case 0x00FF: ch = 0x79; break; - case 0x0100: ch = 0x41; break; - case 0x0101: ch = 0x61; break; - case 0x0102: ch = 0x41; break; - case 0x0103: ch = 0x61; break; - case 0x0104: ch = 0x41; break; - case 0x0105: ch = 0x61; break; - case 0x0106: ch = 0x43; break; - case 0x0107: ch = 0x63; break; - case 0x0108: ch = 0x43; break; - case 0x0109: ch = 0x63; break; - case 0x010A: ch = 0x43; break; - case 0x010B: ch = 0x63; break; - case 0x010C: ch = 0x43; break; - case 0x010D: ch = 0x63; break; - case 0x010E: ch = 0x44; break; - case 0x010F: ch = 0x64; break; - case 0x0110: ch = 0x44; break; - case 0x0111: ch = 0x64; break; - case 0x0112: ch = 0x45; break; - case 0x0113: ch = 0x65; break; - case 0x0114: ch = 0x45; break; - case 0x0115: ch = 0x65; break; - case 0x0116: ch = 0x45; break; - case 0x0117: ch = 0x65; break; - case 0x0118: ch = 0x45; break; - case 0x0119: ch = 0x65; break; - case 0x011A: ch = 0x45; break; - case 0x011B: ch = 0x65; break; - case 0x011C: ch = 0x47; break; - case 0x011D: ch = 0x67; break; - case 0x011E: ch = 0x47; break; - case 0x011F: ch = 0x67; break; - case 0x0120: ch = 0x47; break; - case 0x0121: ch = 0x67; break; - case 0x0122: ch = 0x47; break; - case 0x0123: ch = 0x67; break; - case 0x0124: ch = 0x48; break; - case 0x0125: ch = 0x68; break; - case 0x0126: ch = 0x48; break; - case 0x0127: ch = 0x68; break; - case 0x0128: ch = 0x49; break; - case 0x0129: ch = 0x69; break; - case 0x012A: ch = 0x49; break; - case 0x012B: ch = 0x69; break; - case 0x012C: ch = 0x49; break; - case 0x012D: ch = 0x69; break; - case 0x012E: ch = 0x49; break; - case 0x012F: ch = 0x69; break; - case 0x0130: ch = 0x49; break; - case 0x0131: ch = 0x69; break; - case 0x0134: ch = 0x4A; break; - case 0x0135: ch = 0x6A; break; - case 0x0136: ch = 0x4B; break; - case 0x0137: ch = 0x6B; break; - case 0x0139: ch = 0x4C; break; - case 0x013A: ch = 0x6C; break; - case 0x013B: ch = 0x4C; break; - case 0x013C: ch = 0x6C; break; - case 0x013D: ch = 0x4C; break; - case 0x013E: ch = 0x6C; break; - case 0x0141: ch = 0x4C; break; - case 0x0142: ch = 0x6C; break; - case 0x0143: ch = 0x4E; break; - case 0x0144: ch = 0x6E; break; - case 0x0145: ch = 0x4E; break; - case 0x0146: ch = 0x6E; break; - case 0x0147: ch = 0x4E; break; - case 0x0148: ch = 0x6E; break; - case 0x014C: ch = 0x4F; break; - case 0x014D: ch = 0x6F; break; - case 0x014E: ch = 0x4F; break; - case 0x014F: ch = 0x6F; break; - case 0x0150: ch = 0x4F; break; - case 0x0151: ch = 0x6F; break; - case 0x0152: ch = 0x4F; break; - case 0x0153: ch = 0x6F; break; - case 0x0154: ch = 0x52; break; - case 0x0155: ch = 0x72; break; - case 0x0156: ch = 0x52; break; - case 0x0157: ch = 0x72; break; - case 0x0158: ch = 0x52; break; - case 0x0159: ch = 0x72; break; - case 0x015A: ch = 0x53; break; - case 0x015B: ch = 0x73; break; - case 0x015C: ch = 0x53; break; - case 0x015D: ch = 0x73; break; - case 0x015E: ch = 0x53; break; - case 0x015F: ch = 0x73; break; - case 0x0160: ch = 0x53; break; - case 0x0161: ch = 0x73; break; - case 0x0162: ch = 0x54; break; - case 0x0163: ch = 0x74; break; - case 0x0164: ch = 0x54; break; - case 0x0165: ch = 0x74; break; - case 0x0166: ch = 0x54; break; - case 0x0167: ch = 0x74; break; - case 0x0168: ch = 0x55; break; - case 0x0169: ch = 0x75; break; - case 0x016A: ch = 0x55; break; - case 0x016B: ch = 0x75; break; - case 0x016C: ch = 0x55; break; - case 0x016D: ch = 0x75; break; - case 0x016E: ch = 0x55; break; - case 0x016F: ch = 0x75; break; - case 0x0170: ch = 0x55; break; - case 0x0171: ch = 0x75; break; - case 0x0172: ch = 0x55; break; - case 0x0173: ch = 0x75; break; - case 0x0174: ch = 0x57; break; - case 0x0175: ch = 0x77; break; - case 0x0176: ch = 0x59; break; - case 0x0177: ch = 0x79; break; - case 0x0178: ch = 0x59; break; - case 0x0179: ch = 0x5A; break; - case 0x017A: ch = 0x7A; break; - case 0x017B: ch = 0x5A; break; - case 0x017C: ch = 0x7A; break; - case 0x017D: ch = 0x5A; break; - case 0x017E: ch = 0x7A; break; - case 0x0180: ch = 0x62; break; - case 0x0189: ch = 0x44; break; - case 0x0191: ch = 0x46; break; - case 0x0192: ch = 0x66; break; - case 0x0197: ch = 0x49; break; - case 0x019A: ch = 0x6C; break; - case 0x019F: ch = 0x4F; break; - case 0x01A0: ch = 0x4F; break; - case 0x01A1: ch = 0x6F; break; - case 0x01AB: ch = 0x74; break; - case 0x01AE: ch = 0x54; break; - case 0x01AF: ch = 0x55; break; - case 0x01B0: ch = 0x75; break; - case 0x01B6: ch = 0x7A; break; - case 0x01CD: ch = 0x41; break; - case 0x01CE: ch = 0x61; break; - case 0x01CF: ch = 0x49; break; - case 0x01D0: ch = 0x69; break; - case 0x01D1: ch = 0x4F; break; - case 0x01D2: ch = 0x6F; break; - case 0x01D3: ch = 0x55; break; - case 0x01D4: ch = 0x75; break; - case 0x01D5: ch = 0x55; break; - case 0x01D6: ch = 0x75; break; - case 0x01D7: ch = 0x55; break; - case 0x01D8: ch = 0x75; break; - case 0x01D9: ch = 0x55; break; - case 0x01DA: ch = 0x75; break; - case 0x01DB: ch = 0x55; break; - case 0x01DC: ch = 0x75; break; - case 0x01DE: ch = 0x41; break; - case 0x01DF: ch = 0x61; break; - case 0x01E4: ch = 0x47; break; - case 0x01E5: ch = 0x67; break; - case 0x01E6: ch = 0x47; break; - case 0x01E7: ch = 0x67; break; - case 0x01E8: ch = 0x4B; break; - case 0x01E9: ch = 0x6B; break; - case 0x01EA: ch = 0x4F; break; - case 0x01EB: ch = 0x6F; break; - case 0x01EC: ch = 0x4F; break; - case 0x01ED: ch = 0x6F; break; - case 0x01F0: ch = 0x6A; break; - case 0x0261: ch = 0x67; break; - case 0x02B9: ch = 0x27; break; - case 0x02BA: ch = 0x22; break; - case 0x02BC: ch = 0x27; break; - case 0x02C4: ch = 0x5E; break; - case 0x02C6: ch = 0x5E; break; - case 0x02C8: ch = 0x27; break; - case 0x02CB: ch = 0x60; break; - case 0x02CD: ch = 0x5F; break; - case 0x02DC: ch = 0x7E; break; - case 0x0300: ch = 0x60; break; - case 0x0302: ch = 0x5E; break; - case 0x0303: ch = 0x7E; break; - case 0x030E: ch = 0x22; break; - case 0x0331: ch = 0x5F; break; - case 0x0332: ch = 0x5F; break; - case 0x060C: ch = 0xAC; break; - case 0x061B: ch = 0xBB; break; - case 0x061F: ch = 0xBF; break; - case 0x0621: - case 0x0622: - case 0x0623: - case 0x0624: - case 0x0625: - case 0x0626: - case 0x0627: - case 0x0628: - case 0x0629: - case 0x062A: - case 0x062B: - case 0x062C: - case 0x062D: - case 0x062E: - case 0x062F: - case 0x0630: - case 0x0631: - case 0x0632: - case 0x0633: - case 0x0634: - case 0x0635: - case 0x0636: - case 0x0637: - case 0x0638: - case 0x0639: - case 0x063A: - ch -= 0x0560; - break; - case 0x0640: - case 0x0641: - case 0x0642: - case 0x0643: - case 0x0644: - case 0x0645: - case 0x0646: - case 0x0647: - case 0x0648: - case 0x0649: - case 0x064A: - case 0x064B: - case 0x064C: - case 0x064D: - case 0x064E: - case 0x064F: - case 0x0650: - case 0x0651: - case 0x0652: - ch -= 0x0560; - break; - case 0x2000: ch = 0x20; break; - case 0x2001: ch = 0x20; break; - case 0x2002: ch = 0x20; break; - case 0x2003: ch = 0x20; break; - case 0x2004: ch = 0x20; break; - case 0x2005: ch = 0x20; break; - case 0x2006: ch = 0x20; break; - case 0x2010: ch = 0x2D; break; - case 0x2011: ch = 0x2D; break; - case 0x2013: ch = 0x2D; break; - case 0x2014: ch = 0x2D; break; - case 0x2018: ch = 0x27; break; - case 0x2019: ch = 0x27; break; - case 0x201A: ch = 0x2C; break; - case 0x201C: ch = 0x22; break; - case 0x201D: ch = 0x22; break; - case 0x201E: ch = 0x22; break; - case 0x2022: ch = 0x2E; break; - case 0x2026: ch = 0x2E; break; - case 0x2032: ch = 0x27; break; - case 0x2035: ch = 0x60; break; - case 0x2039: ch = 0x3C; break; - case 0x203A: ch = 0x3E; break; - case 0x2122: ch = 0x54; break; - case 0xF7C8: ch = 0xA1; break; - case 0xF7C9: ch = 0xA2; break; - case 0xF7CA: ch = 0xA3; break; - case 0xF7CB: - case 0xF7CC: - case 0xF7CD: - case 0xF7CE: - case 0xF7CF: - case 0xF7D0: - case 0xF7D1: - ch -= 0xF726; - break; - case 0xF7D2: - case 0xF7D3: - case 0xF7D4: - case 0xF7D5: - case 0xF7D6: - case 0xF7D7: - case 0xF7D8: - case 0xF7D9: - case 0xF7DA: - case 0xF7DB: - case 0xF7DC: - case 0xF7DD: - case 0xF7DE: - ch -= 0xF724; - break; - case 0xF7DF: ch = 0xBC; break; - case 0xF7E0: ch = 0xBD; break; - case 0xF7E1: ch = 0xBE; break; - case 0xF7E2: ch = 0xC0; break; - case 0xF7E3: - case 0xF7E4: - case 0xF7E5: - case 0xF7E6: - case 0xF7E7: - ch -= 0xF708; - break; - case 0xF7E8: - case 0xF7E9: - case 0xF7EA: - case 0xF7EB: - case 0xF7EC: - case 0xF7ED: - case 0xF7EE: - case 0xF7EF: - case 0xF7F0: - case 0xF7F1: - case 0xF7F2: - case 0xF7F3: - case 0xF7F4: - ch -= 0xF6F5; - break; - case 0xFF01: - case 0xFF02: - case 0xFF03: - case 0xFF04: - case 0xFF05: - case 0xFF06: - case 0xFF07: - case 0xFF08: - case 0xFF09: - case 0xFF0A: - case 0xFF0B: - case 0xFF0C: - case 0xFF0D: - case 0xFF0E: - case 0xFF0F: - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - case 0xFF1A: - case 0xFF1B: - case 0xFF1C: - case 0xFF1D: - case 0xFF1E: - ch -= 0xFEE0; - break; - case 0xFF20: - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - case 0xFF3B: - case 0xFF3C: - case 0xFF3D: - case 0xFF3E: - case 0xFF3F: - case 0xFF40: - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - case 0xFF5B: - case 0xFF5C: - case 0xFF5D: - case 0xFF5E: - ch -= 0xFEE0; - break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP28596 [Serializable] diff --git a/mcs/class/I18N/MidEast/CP28598.cs b/mcs/class/I18N/MidEast/CP28598.cs index 056fe109936..52f29b08eed 100644 --- a/mcs/class/I18N/MidEast/CP28598.cs +++ b/mcs/class/I18N/MidEast/CP28598.cs @@ -97,12 +97,11 @@ public class CP28598 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP28598 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP28598 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -232,96 +231,6 @@ public class CP28598 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 161) switch(ch) - { - case 0x00A2: - case 0x00A3: - case 0x00A4: - case 0x00A5: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B5: - case 0x00B6: - case 0x00B8: - case 0x00B9: - case 0x00BB: - case 0x00BC: - case 0x00BD: - case 0x00BE: - break; - case 0x00D7: ch = 0xAA; break; - case 0x00F7: ch = 0xBA; break; - case 0x05D0: - case 0x05D1: - case 0x05D2: - case 0x05D3: - case 0x05D4: - case 0x05D5: - case 0x05D6: - case 0x05D7: - case 0x05D8: - case 0x05D9: - case 0x05DA: - case 0x05DB: - case 0x05DC: - case 0x05DD: - case 0x05DE: - case 0x05DF: - case 0x05E0: - case 0x05E1: - case 0x05E2: - case 0x05E3: - case 0x05E4: - case 0x05E5: - case 0x05E6: - case 0x05E7: - case 0x05E8: - case 0x05E9: - case 0x05EA: - ch -= 0x04F0; - break; - case 0x2017: ch = 0xDF; break; - case 0x2022: ch = 0xB7; break; - case 0x203E: ch = 0xAF; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP28598 [Serializable] diff --git a/mcs/class/I18N/MidEast/CP28599.cs b/mcs/class/I18N/MidEast/CP28599.cs index 61045001d0d..68ab74babe0 100644 --- a/mcs/class/I18N/MidEast/CP28599.cs +++ b/mcs/class/I18N/MidEast/CP28599.cs @@ -97,12 +97,11 @@ public class CP28599 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP28599 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP28599 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -222,86 +221,6 @@ public class CP28599 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 208) switch(ch) - { - case 0x00D1: - case 0x00D2: - case 0x00D3: - case 0x00D4: - case 0x00D5: - case 0x00D6: - case 0x00D7: - case 0x00D8: - case 0x00D9: - case 0x00DA: - case 0x00DB: - case 0x00DC: - case 0x00DF: - case 0x00E0: - case 0x00E1: - case 0x00E2: - case 0x00E3: - case 0x00E4: - case 0x00E5: - case 0x00E6: - case 0x00E7: - case 0x00E8: - case 0x00E9: - case 0x00EA: - case 0x00EB: - case 0x00EC: - case 0x00ED: - case 0x00EE: - case 0x00EF: - case 0x00F1: - case 0x00F2: - case 0x00F3: - case 0x00F4: - case 0x00F5: - case 0x00F6: - case 0x00F7: - case 0x00F8: - case 0x00F9: - case 0x00FA: - case 0x00FB: - case 0x00FC: - case 0x00FF: - break; - case 0x011E: ch = 0xD0; break; - case 0x011F: ch = 0xF0; break; - case 0x0130: ch = 0xDD; break; - case 0x0131: ch = 0xFD; break; - case 0x015E: ch = 0xDE; break; - case 0x015F: ch = 0xFE; break; - case 0x203E: ch = 0xAF; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP28599 [Serializable] diff --git a/mcs/class/I18N/MidEast/CP38598.cs b/mcs/class/I18N/MidEast/CP38598.cs index bc8faf29165..7d1f0c15376 100644 --- a/mcs/class/I18N/MidEast/CP38598.cs +++ b/mcs/class/I18N/MidEast/CP38598.cs @@ -97,12 +97,11 @@ public class CP38598 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP38598 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP38598 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -232,96 +231,6 @@ public class CP38598 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 161) switch(ch) - { - case 0x00A2: - case 0x00A3: - case 0x00A4: - case 0x00A5: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B5: - case 0x00B6: - case 0x00B8: - case 0x00B9: - case 0x00BB: - case 0x00BC: - case 0x00BD: - case 0x00BE: - break; - case 0x00D7: ch = 0xAA; break; - case 0x00F7: ch = 0xBA; break; - case 0x05D0: - case 0x05D1: - case 0x05D2: - case 0x05D3: - case 0x05D4: - case 0x05D5: - case 0x05D6: - case 0x05D7: - case 0x05D8: - case 0x05D9: - case 0x05DA: - case 0x05DB: - case 0x05DC: - case 0x05DD: - case 0x05DE: - case 0x05DF: - case 0x05E0: - case 0x05E1: - case 0x05E2: - case 0x05E3: - case 0x05E4: - case 0x05E5: - case 0x05E6: - case 0x05E7: - case 0x05E8: - case 0x05E9: - case 0x05EA: - ch -= 0x04F0; - break; - case 0x2017: ch = 0xDF; break; - case 0x2022: ch = 0xB7; break; - case 0x203E: ch = 0xAF; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP38598 [Serializable] diff --git a/mcs/class/I18N/Other/CP1251.cs b/mcs/class/I18N/Other/CP1251.cs index 6b7be218bbd..d7f7987d536 100644 --- a/mcs/class/I18N/Other/CP1251.cs +++ b/mcs/class/I18N/Other/CP1251.cs @@ -97,12 +97,11 @@ public class CP1251 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1251 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1251 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -303,167 +302,6 @@ public class CP1251 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x0098: - case 0x00A0: - case 0x00A4: - case 0x00A6: - case 0x00A7: - case 0x00A9: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00B0: - case 0x00B1: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00BB: - break; - case 0x0401: ch = 0xA8; break; - case 0x0402: ch = 0x80; break; - case 0x0403: ch = 0x81; break; - case 0x0404: ch = 0xAA; break; - case 0x0405: ch = 0xBD; break; - case 0x0406: ch = 0xB2; break; - case 0x0407: ch = 0xAF; break; - case 0x0408: ch = 0xA3; break; - case 0x0409: ch = 0x8A; break; - case 0x040A: ch = 0x8C; break; - case 0x040B: ch = 0x8E; break; - case 0x040C: ch = 0x8D; break; - case 0x040E: ch = 0xA1; break; - case 0x040F: ch = 0x8F; break; - case 0x0410: - case 0x0411: - case 0x0412: - case 0x0413: - case 0x0414: - case 0x0415: - case 0x0416: - case 0x0417: - case 0x0418: - case 0x0419: - case 0x041A: - case 0x041B: - case 0x041C: - case 0x041D: - case 0x041E: - case 0x041F: - case 0x0420: - case 0x0421: - case 0x0422: - case 0x0423: - case 0x0424: - case 0x0425: - case 0x0426: - case 0x0427: - case 0x0428: - case 0x0429: - case 0x042A: - case 0x042B: - case 0x042C: - case 0x042D: - case 0x042E: - case 0x042F: - case 0x0430: - case 0x0431: - case 0x0432: - case 0x0433: - case 0x0434: - case 0x0435: - case 0x0436: - case 0x0437: - case 0x0438: - case 0x0439: - case 0x043A: - case 0x043B: - case 0x043C: - case 0x043D: - case 0x043E: - case 0x043F: - case 0x0440: - case 0x0441: - case 0x0442: - case 0x0443: - case 0x0444: - case 0x0445: - case 0x0446: - case 0x0447: - case 0x0448: - case 0x0449: - case 0x044A: - case 0x044B: - case 0x044C: - case 0x044D: - case 0x044E: - case 0x044F: - ch -= 0x0350; - break; - case 0x0451: ch = 0xB8; break; - case 0x0452: ch = 0x90; break; - case 0x0453: ch = 0x83; break; - case 0x0454: ch = 0xBA; break; - case 0x0455: ch = 0xBE; break; - case 0x0456: ch = 0xB3; break; - case 0x0457: ch = 0xBF; break; - case 0x0458: ch = 0xBC; break; - case 0x0459: ch = 0x9A; break; - case 0x045A: ch = 0x9C; break; - case 0x045B: ch = 0x9E; break; - case 0x045C: ch = 0x9D; break; - case 0x045E: ch = 0xA2; break; - case 0x045F: ch = 0x9F; break; - case 0x0490: ch = 0xA5; break; - case 0x0491: ch = 0xB4; break; - case 0x2013: ch = 0x96; break; - case 0x2014: ch = 0x97; break; - case 0x2018: ch = 0x91; break; - case 0x2019: ch = 0x92; break; - case 0x201A: ch = 0x82; break; - case 0x201C: ch = 0x93; break; - case 0x201D: ch = 0x94; break; - case 0x201E: ch = 0x84; break; - case 0x2020: ch = 0x86; break; - case 0x2021: ch = 0x87; break; - case 0x2022: ch = 0x95; break; - case 0x2026: ch = 0x85; break; - case 0x2030: ch = 0x89; break; - case 0x2039: ch = 0x8B; break; - case 0x203A: ch = 0x9B; break; - case 0x20AC: ch = 0x88; break; - case 0x2116: ch = 0xB9; break; - case 0x2122: ch = 0x99; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1251 [Serializable] diff --git a/mcs/class/I18N/Other/CP1257.cs b/mcs/class/I18N/Other/CP1257.cs index e97f82d75d3..1f6860f7c1d 100644 --- a/mcs/class/I18N/Other/CP1257.cs +++ b/mcs/class/I18N/Other/CP1257.cs @@ -97,12 +97,11 @@ public class CP1257 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1257 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1257 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -299,163 +298,6 @@ public class CP1257 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x0081: - case 0x0083: - case 0x0088: - case 0x008A: - case 0x008C: - case 0x0090: - case 0x0098: - case 0x009A: - case 0x009C: - case 0x009F: - case 0x00A0: - case 0x00A2: - case 0x00A3: - case 0x00A4: - case 0x00A6: - case 0x00A7: - case 0x00A9: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00B9: - case 0x00BB: - case 0x00BC: - case 0x00BD: - case 0x00BE: - case 0x00C4: - case 0x00C5: - case 0x00C9: - case 0x00D3: - case 0x00D5: - case 0x00D6: - case 0x00D7: - case 0x00DC: - case 0x00DF: - case 0x00E4: - case 0x00E5: - case 0x00E9: - case 0x00F3: - case 0x00F5: - case 0x00F6: - case 0x00F7: - case 0x00FC: - break; - case 0x00A8: ch = 0x8D; break; - case 0x00AF: ch = 0x9D; break; - case 0x00B8: ch = 0x8F; break; - case 0x00C6: ch = 0xAF; break; - case 0x00D8: ch = 0xA8; break; - case 0x00E6: ch = 0xBF; break; - case 0x00F8: ch = 0xB8; break; - case 0x0100: ch = 0xC2; break; - case 0x0101: ch = 0xE2; break; - case 0x0104: ch = 0xC0; break; - case 0x0105: ch = 0xE0; break; - case 0x0106: ch = 0xC3; break; - case 0x0107: ch = 0xE3; break; - case 0x010C: ch = 0xC8; break; - case 0x010D: ch = 0xE8; break; - case 0x0112: ch = 0xC7; break; - case 0x0113: ch = 0xE7; break; - case 0x0116: ch = 0xCB; break; - case 0x0117: ch = 0xEB; break; - case 0x0118: ch = 0xC6; break; - case 0x0119: ch = 0xE6; break; - case 0x0122: ch = 0xCC; break; - case 0x0123: ch = 0xEC; break; - case 0x012A: ch = 0xCE; break; - case 0x012B: ch = 0xEE; break; - case 0x012E: ch = 0xC1; break; - case 0x012F: ch = 0xE1; break; - case 0x0136: ch = 0xCD; break; - case 0x0137: ch = 0xED; break; - case 0x013B: ch = 0xCF; break; - case 0x013C: ch = 0xEF; break; - case 0x0141: ch = 0xD9; break; - case 0x0142: ch = 0xF9; break; - case 0x0143: ch = 0xD1; break; - case 0x0144: ch = 0xF1; break; - case 0x0145: ch = 0xD2; break; - case 0x0146: ch = 0xF2; break; - case 0x014C: ch = 0xD4; break; - case 0x014D: ch = 0xF4; break; - case 0x0156: ch = 0xAA; break; - case 0x0157: ch = 0xBA; break; - case 0x015A: ch = 0xDA; break; - case 0x015B: ch = 0xFA; break; - case 0x0160: ch = 0xD0; break; - case 0x0161: ch = 0xF0; break; - case 0x016A: ch = 0xDB; break; - case 0x016B: ch = 0xFB; break; - case 0x0172: ch = 0xD8; break; - case 0x0173: ch = 0xF8; break; - case 0x0179: ch = 0xCA; break; - case 0x017A: ch = 0xEA; break; - case 0x017B: ch = 0xDD; break; - case 0x017C: ch = 0xFD; break; - case 0x017D: ch = 0xDE; break; - case 0x017E: ch = 0xFE; break; - case 0x02C7: ch = 0x8E; break; - case 0x02D9: ch = 0xFF; break; - case 0x02DB: ch = 0x9E; break; - case 0x2013: ch = 0x96; break; - case 0x2014: ch = 0x97; break; - case 0x2018: ch = 0x91; break; - case 0x2019: ch = 0x92; break; - case 0x201A: ch = 0x82; break; - case 0x201C: ch = 0x93; break; - case 0x201D: ch = 0x94; break; - case 0x201E: ch = 0x84; break; - case 0x2020: ch = 0x86; break; - case 0x2021: ch = 0x87; break; - case 0x2022: ch = 0x95; break; - case 0x2026: ch = 0x85; break; - case 0x2030: ch = 0x89; break; - case 0x2039: ch = 0x8B; break; - case 0x203A: ch = 0x9B; break; - case 0x20AC: ch = 0x80; break; - case 0x2122: ch = 0x99; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1257 [Serializable] diff --git a/mcs/class/I18N/Other/CP1258.cs b/mcs/class/I18N/Other/CP1258.cs index 2f02f0763ed..ecad3cdc15d 100644 --- a/mcs/class/I18N/Other/CP1258.cs +++ b/mcs/class/I18N/Other/CP1258.cs @@ -97,12 +97,11 @@ public class CP1258 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1258 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1258 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -301,165 +300,6 @@ public class CP1258 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x0081: - case 0x008A: - case 0x008D: - case 0x008E: - case 0x008F: - case 0x0090: - case 0x009A: - case 0x009D: - case 0x009E: - case 0x00A0: - case 0x00A1: - case 0x00A2: - case 0x00A3: - case 0x00A4: - case 0x00A5: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AA: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00AF: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00B8: - case 0x00B9: - case 0x00BA: - case 0x00BB: - case 0x00BC: - case 0x00BD: - case 0x00BE: - case 0x00BF: - case 0x00C0: - case 0x00C1: - case 0x00C2: - case 0x00C4: - case 0x00C5: - case 0x00C6: - case 0x00C7: - case 0x00C8: - case 0x00C9: - case 0x00CA: - case 0x00CB: - case 0x00CD: - case 0x00CE: - case 0x00CF: - case 0x00D1: - case 0x00D3: - case 0x00D4: - case 0x00D6: - case 0x00D7: - case 0x00D8: - case 0x00D9: - case 0x00DA: - case 0x00DB: - case 0x00DC: - case 0x00DF: - case 0x00E0: - case 0x00E1: - case 0x00E2: - case 0x00E4: - case 0x00E5: - case 0x00E6: - case 0x00E7: - case 0x00E8: - case 0x00E9: - case 0x00EA: - case 0x00EB: - case 0x00ED: - case 0x00EE: - case 0x00EF: - case 0x00F1: - case 0x00F3: - case 0x00F4: - case 0x00F6: - case 0x00F7: - case 0x00F8: - case 0x00F9: - case 0x00FA: - case 0x00FB: - case 0x00FC: - case 0x00FF: - break; - case 0x0102: ch = 0xC3; break; - case 0x0103: ch = 0xE3; break; - case 0x0110: ch = 0xD0; break; - case 0x0111: ch = 0xF0; break; - case 0x0152: ch = 0x8C; break; - case 0x0153: ch = 0x9C; break; - case 0x0178: ch = 0x9F; break; - case 0x0192: ch = 0x83; break; - case 0x01A0: ch = 0xD5; break; - case 0x01A1: ch = 0xF5; break; - case 0x01AF: ch = 0xDD; break; - case 0x01B0: ch = 0xFD; break; - case 0x02C6: ch = 0x88; break; - case 0x02DC: ch = 0x98; break; - case 0x0300: ch = 0xCC; break; - case 0x0301: ch = 0xEC; break; - case 0x0303: ch = 0xDE; break; - case 0x0309: ch = 0xD2; break; - case 0x0323: ch = 0xF2; break; - case 0x2013: ch = 0x96; break; - case 0x2014: ch = 0x97; break; - case 0x2018: ch = 0x91; break; - case 0x2019: ch = 0x92; break; - case 0x201A: ch = 0x82; break; - case 0x201C: ch = 0x93; break; - case 0x201D: ch = 0x94; break; - case 0x201E: ch = 0x84; break; - case 0x2020: ch = 0x86; break; - case 0x2021: ch = 0x87; break; - case 0x2022: ch = 0x95; break; - case 0x2026: ch = 0x85; break; - case 0x2030: ch = 0x89; break; - case 0x2039: ch = 0x8B; break; - case 0x203A: ch = 0x9B; break; - case 0x20AB: ch = 0xFE; break; - case 0x20AC: ch = 0x80; break; - case 0x2122: ch = 0x99; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1258 [Serializable] diff --git a/mcs/class/I18N/Other/CP20866.cs b/mcs/class/I18N/Other/CP20866.cs index 55ff10b9105..59d3672d3df 100644 --- a/mcs/class/I18N/Other/CP20866.cs +++ b/mcs/class/I18N/Other/CP20866.cs @@ -97,12 +97,11 @@ public class CP20866 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20866 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20866 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -316,180 +315,6 @@ public class CP20866 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x00A0: ch = 0x9A; break; - case 0x00A9: ch = 0xBF; break; - case 0x00B0: ch = 0x9C; break; - case 0x00B2: ch = 0x9D; break; - case 0x00B7: ch = 0x9E; break; - case 0x00F7: ch = 0x9F; break; - case 0x0401: ch = 0xB3; break; - case 0x0410: ch = 0xE1; break; - case 0x0411: ch = 0xE2; break; - case 0x0412: ch = 0xF7; break; - case 0x0413: ch = 0xE7; break; - case 0x0414: ch = 0xE4; break; - case 0x0415: ch = 0xE5; break; - case 0x0416: ch = 0xF6; break; - case 0x0417: ch = 0xFA; break; - case 0x0418: - case 0x0419: - case 0x041A: - case 0x041B: - case 0x041C: - case 0x041D: - case 0x041E: - case 0x041F: - ch -= 0x032F; - break; - case 0x0420: - case 0x0421: - case 0x0422: - case 0x0423: - ch -= 0x032E; - break; - case 0x0424: ch = 0xE6; break; - case 0x0425: ch = 0xE8; break; - case 0x0426: ch = 0xE3; break; - case 0x0427: ch = 0xFE; break; - case 0x0428: ch = 0xFB; break; - case 0x0429: ch = 0xFD; break; - case 0x042A: ch = 0xFF; break; - case 0x042B: ch = 0xF9; break; - case 0x042C: ch = 0xF8; break; - case 0x042D: ch = 0xFC; break; - case 0x042E: ch = 0xE0; break; - case 0x042F: ch = 0xF1; break; - case 0x0430: ch = 0xC1; break; - case 0x0431: ch = 0xC2; break; - case 0x0432: ch = 0xD7; break; - case 0x0433: ch = 0xC7; break; - case 0x0434: ch = 0xC4; break; - case 0x0435: ch = 0xC5; break; - case 0x0436: ch = 0xD6; break; - case 0x0437: ch = 0xDA; break; - case 0x0438: - case 0x0439: - case 0x043A: - case 0x043B: - case 0x043C: - case 0x043D: - case 0x043E: - case 0x043F: - ch -= 0x036F; - break; - case 0x0440: - case 0x0441: - case 0x0442: - case 0x0443: - ch -= 0x036E; - break; - case 0x0444: ch = 0xC6; break; - case 0x0445: ch = 0xC8; break; - case 0x0446: ch = 0xC3; break; - case 0x0447: ch = 0xDE; break; - case 0x0448: ch = 0xDB; break; - case 0x0449: ch = 0xDD; break; - case 0x044A: ch = 0xDF; break; - case 0x044B: ch = 0xD9; break; - case 0x044C: ch = 0xD8; break; - case 0x044D: ch = 0xDC; break; - case 0x044E: ch = 0xC0; break; - case 0x044F: ch = 0xD1; break; - case 0x0451: ch = 0xA3; break; - case 0x2219: ch = 0x95; break; - case 0x221A: ch = 0x96; break; - case 0x2248: ch = 0x97; break; - case 0x2264: ch = 0x98; break; - case 0x2265: ch = 0x99; break; - case 0x2320: ch = 0x93; break; - case 0x2321: ch = 0x9B; break; - case 0x2500: ch = 0x80; break; - case 0x2502: ch = 0x81; break; - case 0x250C: ch = 0x82; break; - case 0x2510: ch = 0x83; break; - case 0x2514: ch = 0x84; break; - case 0x2518: ch = 0x85; break; - case 0x251C: ch = 0x86; break; - case 0x2524: ch = 0x87; break; - case 0x252C: ch = 0x88; break; - case 0x2534: ch = 0x89; break; - case 0x253C: ch = 0x8A; break; - case 0x2550: ch = 0xA0; break; - case 0x2551: ch = 0xA1; break; - case 0x2552: ch = 0xA2; break; - case 0x2553: - case 0x2554: - case 0x2555: - case 0x2556: - case 0x2557: - case 0x2558: - case 0x2559: - case 0x255A: - case 0x255B: - case 0x255C: - case 0x255D: - case 0x255E: - case 0x255F: - case 0x2560: - case 0x2561: - ch -= 0x24AF; - break; - case 0x2562: - case 0x2563: - case 0x2564: - case 0x2565: - case 0x2566: - case 0x2567: - case 0x2568: - case 0x2569: - case 0x256A: - case 0x256B: - case 0x256C: - ch -= 0x24AE; - break; - case 0x2580: ch = 0x8B; break; - case 0x2584: ch = 0x8C; break; - case 0x2588: ch = 0x8D; break; - case 0x258C: ch = 0x8E; break; - case 0x2590: - case 0x2591: - case 0x2592: - case 0x2593: - ch -= 0x2501; - break; - case 0x25A0: ch = 0x94; break; - case 0xFFE8: ch = 0x81; break; - case 0xFFED: ch = 0x94; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20866 [Serializable] diff --git a/mcs/class/I18N/Other/CP21866.cs b/mcs/class/I18N/Other/CP21866.cs index 1074083c46f..19ea365f4cb 100644 --- a/mcs/class/I18N/Other/CP21866.cs +++ b/mcs/class/I18N/Other/CP21866.cs @@ -97,12 +97,11 @@ public class CP21866 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP21866 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP21866 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -316,180 +315,6 @@ public class CP21866 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x00A0: ch = 0x9A; break; - case 0x00A9: ch = 0xBF; break; - case 0x00B0: ch = 0x9C; break; - case 0x00B2: ch = 0x9D; break; - case 0x00B7: ch = 0x9E; break; - case 0x00F7: ch = 0x9F; break; - case 0x0401: ch = 0xB3; break; - case 0x0404: ch = 0xB4; break; - case 0x0406: ch = 0xB6; break; - case 0x0407: ch = 0xB7; break; - case 0x0410: ch = 0xE1; break; - case 0x0411: ch = 0xE2; break; - case 0x0412: ch = 0xF7; break; - case 0x0413: ch = 0xE7; break; - case 0x0414: ch = 0xE4; break; - case 0x0415: ch = 0xE5; break; - case 0x0416: ch = 0xF6; break; - case 0x0417: ch = 0xFA; break; - case 0x0418: - case 0x0419: - case 0x041A: - case 0x041B: - case 0x041C: - case 0x041D: - case 0x041E: - case 0x041F: - ch -= 0x032F; - break; - case 0x0420: - case 0x0421: - case 0x0422: - case 0x0423: - ch -= 0x032E; - break; - case 0x0424: ch = 0xE6; break; - case 0x0425: ch = 0xE8; break; - case 0x0426: ch = 0xE3; break; - case 0x0427: ch = 0xFE; break; - case 0x0428: ch = 0xFB; break; - case 0x0429: ch = 0xFD; break; - case 0x042A: ch = 0xFF; break; - case 0x042B: ch = 0xF9; break; - case 0x042C: ch = 0xF8; break; - case 0x042D: ch = 0xFC; break; - case 0x042E: ch = 0xE0; break; - case 0x042F: ch = 0xF1; break; - case 0x0430: ch = 0xC1; break; - case 0x0431: ch = 0xC2; break; - case 0x0432: ch = 0xD7; break; - case 0x0433: ch = 0xC7; break; - case 0x0434: ch = 0xC4; break; - case 0x0435: ch = 0xC5; break; - case 0x0436: ch = 0xD6; break; - case 0x0437: ch = 0xDA; break; - case 0x0438: - case 0x0439: - case 0x043A: - case 0x043B: - case 0x043C: - case 0x043D: - case 0x043E: - case 0x043F: - ch -= 0x036F; - break; - case 0x0440: - case 0x0441: - case 0x0442: - case 0x0443: - ch -= 0x036E; - break; - case 0x0444: ch = 0xC6; break; - case 0x0445: ch = 0xC8; break; - case 0x0446: ch = 0xC3; break; - case 0x0447: ch = 0xDE; break; - case 0x0448: ch = 0xDB; break; - case 0x0449: ch = 0xDD; break; - case 0x044A: ch = 0xDF; break; - case 0x044B: ch = 0xD9; break; - case 0x044C: ch = 0xD8; break; - case 0x044D: ch = 0xDC; break; - case 0x044E: ch = 0xC0; break; - case 0x044F: ch = 0xD1; break; - case 0x0451: ch = 0xA3; break; - case 0x0454: ch = 0xA4; break; - case 0x0456: ch = 0xA6; break; - case 0x0457: ch = 0xA7; break; - case 0x0490: ch = 0xBD; break; - case 0x0491: ch = 0xAD; break; - case 0x2219: ch = 0x95; break; - case 0x221A: ch = 0x96; break; - case 0x2248: ch = 0x97; break; - case 0x2264: ch = 0x98; break; - case 0x2265: ch = 0x99; break; - case 0x2320: ch = 0x93; break; - case 0x2321: ch = 0x9B; break; - case 0x2500: ch = 0x80; break; - case 0x2502: ch = 0x81; break; - case 0x250C: ch = 0x82; break; - case 0x2510: ch = 0x83; break; - case 0x2514: ch = 0x84; break; - case 0x2518: ch = 0x85; break; - case 0x251C: ch = 0x86; break; - case 0x2524: ch = 0x87; break; - case 0x252C: ch = 0x88; break; - case 0x2534: ch = 0x89; break; - case 0x253C: ch = 0x8A; break; - case 0x2550: ch = 0xA0; break; - case 0x2551: ch = 0xA1; break; - case 0x2552: ch = 0xA2; break; - case 0x2554: ch = 0xA5; break; - case 0x2557: - case 0x2558: - case 0x2559: - case 0x255A: - case 0x255B: - ch -= 0x24AF; - break; - case 0x255D: - case 0x255E: - case 0x255F: - case 0x2560: - case 0x2561: - ch -= 0x24AF; - break; - case 0x2563: ch = 0xB5; break; - case 0x2566: - case 0x2567: - case 0x2568: - case 0x2569: - case 0x256A: - ch -= 0x24AE; - break; - case 0x256C: ch = 0xBE; break; - case 0x2580: ch = 0x8B; break; - case 0x2584: ch = 0x8C; break; - case 0x2588: ch = 0x8D; break; - case 0x258C: ch = 0x8E; break; - case 0x2590: - case 0x2591: - case 0x2592: - case 0x2593: - ch -= 0x2501; - break; - case 0x25A0: ch = 0x94; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP21866 [Serializable] diff --git a/mcs/class/I18N/Other/CP28594.cs b/mcs/class/I18N/Other/CP28594.cs index e96d8975016..630b1437f2d 100644 --- a/mcs/class/I18N/Other/CP28594.cs +++ b/mcs/class/I18N/Other/CP28594.cs @@ -97,12 +97,11 @@ public class CP28594 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP28594 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP28594 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -268,132 +267,6 @@ public class CP28594 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 161) switch(ch) - { - case 0x00A4: - case 0x00A7: - case 0x00A8: - case 0x00AD: - case 0x00AF: - case 0x00B0: - case 0x00B4: - case 0x00B8: - case 0x00C1: - case 0x00C2: - case 0x00C3: - case 0x00C4: - case 0x00C5: - case 0x00C6: - case 0x00C9: - case 0x00CB: - case 0x00CD: - case 0x00CE: - case 0x00D4: - case 0x00D5: - case 0x00D6: - case 0x00D7: - case 0x00D8: - case 0x00DA: - case 0x00DB: - case 0x00DC: - case 0x00DF: - case 0x00E1: - case 0x00E2: - case 0x00E3: - case 0x00E4: - case 0x00E5: - case 0x00E6: - case 0x00E9: - case 0x00EB: - case 0x00ED: - case 0x00EE: - case 0x00F4: - case 0x00F5: - case 0x00F6: - case 0x00F7: - case 0x00F8: - case 0x00FA: - case 0x00FB: - case 0x00FC: - break; - case 0x0100: ch = 0xC0; break; - case 0x0101: ch = 0xE0; break; - case 0x0104: ch = 0xA1; break; - case 0x0105: ch = 0xB1; break; - case 0x010C: ch = 0xC8; break; - case 0x010D: ch = 0xE8; break; - case 0x0110: ch = 0xD0; break; - case 0x0111: ch = 0xF0; break; - case 0x0112: ch = 0xAA; break; - case 0x0113: ch = 0xBA; break; - case 0x0116: ch = 0xCC; break; - case 0x0117: ch = 0xEC; break; - case 0x0118: ch = 0xCA; break; - case 0x0119: ch = 0xEA; break; - case 0x0122: ch = 0xAB; break; - case 0x0123: ch = 0xBB; break; - case 0x0128: ch = 0xA5; break; - case 0x0129: ch = 0xB5; break; - case 0x012A: ch = 0xCF; break; - case 0x012B: ch = 0xEF; break; - case 0x012E: ch = 0xC7; break; - case 0x012F: ch = 0xE7; break; - case 0x0136: ch = 0xD3; break; - case 0x0137: ch = 0xF3; break; - case 0x0138: ch = 0xA2; break; - case 0x013B: ch = 0xA6; break; - case 0x013C: ch = 0xB6; break; - case 0x0145: ch = 0xD1; break; - case 0x0146: ch = 0xF1; break; - case 0x014A: ch = 0xBD; break; - case 0x014B: ch = 0xBF; break; - case 0x014C: ch = 0xD2; break; - case 0x014D: ch = 0xF2; break; - case 0x0156: ch = 0xA3; break; - case 0x0157: ch = 0xB3; break; - case 0x0160: ch = 0xA9; break; - case 0x0161: ch = 0xB9; break; - case 0x0166: ch = 0xAC; break; - case 0x0167: ch = 0xBC; break; - case 0x0168: ch = 0xDD; break; - case 0x0169: ch = 0xFD; break; - case 0x016A: ch = 0xDE; break; - case 0x016B: ch = 0xFE; break; - case 0x0172: ch = 0xD9; break; - case 0x0173: ch = 0xF9; break; - case 0x017D: ch = 0xAE; break; - case 0x017E: ch = 0xBE; break; - case 0x02C7: ch = 0xB7; break; - case 0x02D9: ch = 0xFF; break; - case 0x02DB: ch = 0xB2; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP28594 [Serializable] diff --git a/mcs/class/I18N/Other/CP28595.cs b/mcs/class/I18N/Other/CP28595.cs index ee6af994705..ef97fb2d38a 100644 --- a/mcs/class/I18N/Other/CP28595.cs +++ b/mcs/class/I18N/Other/CP28595.cs @@ -97,12 +97,11 @@ public class CP28595 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP28595 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP28595 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -274,138 +273,6 @@ public class CP28595 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 161) switch(ch) - { - case 0x00AD: - break; - case 0x00A7: ch = 0xFD; break; - case 0x0401: - case 0x0402: - case 0x0403: - case 0x0404: - case 0x0405: - case 0x0406: - case 0x0407: - case 0x0408: - case 0x0409: - case 0x040A: - case 0x040B: - case 0x040C: - ch -= 0x0360; - break; - case 0x040E: - case 0x040F: - case 0x0410: - case 0x0411: - case 0x0412: - case 0x0413: - case 0x0414: - case 0x0415: - case 0x0416: - case 0x0417: - case 0x0418: - case 0x0419: - case 0x041A: - case 0x041B: - case 0x041C: - case 0x041D: - case 0x041E: - case 0x041F: - case 0x0420: - case 0x0421: - case 0x0422: - case 0x0423: - case 0x0424: - case 0x0425: - case 0x0426: - case 0x0427: - case 0x0428: - case 0x0429: - case 0x042A: - case 0x042B: - case 0x042C: - case 0x042D: - case 0x042E: - case 0x042F: - case 0x0430: - case 0x0431: - case 0x0432: - case 0x0433: - case 0x0434: - case 0x0435: - case 0x0436: - case 0x0437: - case 0x0438: - case 0x0439: - case 0x043A: - case 0x043B: - case 0x043C: - case 0x043D: - case 0x043E: - case 0x043F: - case 0x0440: - case 0x0441: - case 0x0442: - case 0x0443: - case 0x0444: - case 0x0445: - case 0x0446: - case 0x0447: - case 0x0448: - case 0x0449: - case 0x044A: - case 0x044B: - case 0x044C: - case 0x044D: - case 0x044E: - case 0x044F: - ch -= 0x0360; - break; - case 0x0451: - case 0x0452: - case 0x0453: - case 0x0454: - case 0x0455: - case 0x0456: - case 0x0457: - case 0x0458: - case 0x0459: - case 0x045A: - case 0x045B: - case 0x045C: - ch -= 0x0360; - break; - case 0x045E: ch = 0xFE; break; - case 0x045F: ch = 0xFF; break; - case 0x2116: ch = 0xF0; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP28595 [Serializable] diff --git a/mcs/class/I18N/Other/CP874.cs b/mcs/class/I18N/Other/CP874.cs index 99acce956f7..b987ec8e16b 100644 --- a/mcs/class/I18N/Other/CP874.cs +++ b/mcs/class/I18N/Other/CP874.cs @@ -97,12 +97,11 @@ public class CP874 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP874 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP874 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -370,234 +369,6 @@ public class CP874 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A2: ch = 0xFC; break; - case 0x00A6: ch = 0xFE; break; - case 0x00AC: ch = 0xFD; break; - case 0x0E01: - case 0x0E02: - case 0x0E03: - case 0x0E04: - case 0x0E05: - case 0x0E06: - case 0x0E07: - case 0x0E08: - case 0x0E09: - case 0x0E0A: - case 0x0E0B: - case 0x0E0C: - case 0x0E0D: - case 0x0E0E: - case 0x0E0F: - case 0x0E10: - case 0x0E11: - case 0x0E12: - case 0x0E13: - case 0x0E14: - case 0x0E15: - case 0x0E16: - case 0x0E17: - case 0x0E18: - case 0x0E19: - case 0x0E1A: - case 0x0E1B: - case 0x0E1C: - case 0x0E1D: - case 0x0E1E: - case 0x0E1F: - case 0x0E20: - case 0x0E21: - case 0x0E22: - case 0x0E23: - case 0x0E24: - case 0x0E25: - case 0x0E26: - case 0x0E27: - case 0x0E28: - case 0x0E29: - case 0x0E2A: - case 0x0E2B: - case 0x0E2C: - case 0x0E2D: - case 0x0E2E: - case 0x0E2F: - case 0x0E30: - case 0x0E31: - case 0x0E32: - case 0x0E33: - case 0x0E34: - case 0x0E35: - case 0x0E36: - case 0x0E37: - case 0x0E38: - case 0x0E39: - case 0x0E3A: - ch -= 0x0D60; - break; - case 0x0E3F: - case 0x0E40: - case 0x0E41: - case 0x0E42: - case 0x0E43: - case 0x0E44: - case 0x0E45: - case 0x0E46: - case 0x0E47: - case 0x0E48: - case 0x0E49: - case 0x0E4A: - case 0x0E4B: - case 0x0E4C: - case 0x0E4D: - case 0x0E4E: - case 0x0E4F: - case 0x0E50: - case 0x0E51: - case 0x0E52: - case 0x0E53: - case 0x0E54: - case 0x0E55: - case 0x0E56: - case 0x0E57: - case 0x0E58: - case 0x0E59: - case 0x0E5A: - case 0x0E5B: - ch -= 0x0D60; - break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP874 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1026.cs b/mcs/class/I18N/Rare/CP1026.cs index 8b7777fcf21..cf0d4d74545 100644 --- a/mcs/class/I18N/Rare/CP1026.cs +++ b/mcs/class/I18N/Rare/CP1026.cs @@ -97,12 +97,11 @@ public class CP1026 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1026 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1026 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1026 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0xFC; break; - case 0x0023: ch = 0xEC; break; - case 0x0024: ch = 0xAD; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0xAE; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x68; break; - case 0x005C: ch = 0xDC; break; - case 0x005D: ch = 0xAC; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x8D; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x48; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x8C; break; - case 0x007E: ch = 0xCC; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x8E; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x4A; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0x7B; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0x7F; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0xC0; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xA1; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xE0; break; - case 0x00FF: ch = 0xDF; break; - case 0x011E: ch = 0x5A; break; - case 0x011F: ch = 0xD0; break; - case 0x0130: ch = 0x5B; break; - case 0x0131: ch = 0x79; break; - case 0x015E: ch = 0x7C; break; - case 0x015F: ch = 0x6A; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0xFC; break; - case 0xFF03: ch = 0xEC; break; - case 0xFF04: ch = 0xAD; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0xAE; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x68; break; - case 0xFF3C: ch = 0xDC; break; - case 0xFF3D: ch = 0xAC; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x8D; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x48; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x8C; break; - case 0xFF5E: ch = 0xCC; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1026 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1047.cs b/mcs/class/I18N/Rare/CP1047.cs index 3ab08e93b65..53c47a41e04 100644 --- a/mcs/class/I18N/Rare/CP1047.cs +++ b/mcs/class/I18N/Rare/CP1047.cs @@ -97,12 +97,11 @@ public class CP1047 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1047 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1047 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1047 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x5A; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xAD; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0xBD; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x4F; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA1; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0x4A; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBB; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xB0; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xBA; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x5A; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xAD; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0xBD; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x4F; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA1; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1047 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1140.cs b/mcs/class/I18N/Rare/CP1140.cs index 3a77faac531..9a235e44d3b 100644 --- a/mcs/class/I18N/Rare/CP1140.cs +++ b/mcs/class/I18N/Rare/CP1140.cs @@ -97,12 +97,11 @@ public class CP1140 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1140 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1140 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1140 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x5A; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xBA; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0xBB; break; - case 0x005E: ch = 0xB0; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x4F; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA1; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0x4A; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0x5F; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0x20AC: ch = 0x9F; break; - case 0xFF01: ch = 0x5A; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xBA; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0xBB; break; - case 0xFF3E: ch = 0xB0; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x4F; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA1; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1140 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1141.cs b/mcs/class/I18N/Rare/CP1141.cs index 16c30e06980..2415290d234 100644 --- a/mcs/class/I18N/Rare/CP1141.cs +++ b/mcs/class/I18N/Rare/CP1141.cs @@ -97,12 +97,11 @@ public class CP1141 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1141 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1141 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1141 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0xB5; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x63; break; - case 0x005C: ch = 0xEC; break; - case 0x005D: ch = 0xFC; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x43; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0xDC; break; - case 0x007E: ch = 0x59; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0xCC; break; - case 0x00A7: ch = 0x7C; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x4A; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xE0; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0x5A; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0xA1; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0xC0; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0x6A; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xD0; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0x20AC: ch = 0x9F; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0xB5; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x63; break; - case 0xFF3C: ch = 0xEC; break; - case 0xFF3D: ch = 0xFC; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x43; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0xDC; break; - case 0xFF5E: ch = 0x59; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1141 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1142.cs b/mcs/class/I18N/Rare/CP1142.cs index b5414e90ab0..51bc8995af7 100644 --- a/mcs/class/I18N/Rare/CP1142.cs +++ b/mcs/class/I18N/Rare/CP1142.cs @@ -97,12 +97,11 @@ public class CP1142 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1142 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1142 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1142 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x4A; break; - case 0x0024: ch = 0x67; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x80; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x9E; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0x9F; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x9C; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x47; break; - case 0x007E: ch = 0xDC; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x70; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x5B; break; - case 0x00C6: ch = 0x7B; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x7C; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0xD0; break; - case 0x00E6: ch = 0xC0; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x6A; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xA1; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0x20AC: ch = 0x5A; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x4A; break; - case 0xFF04: ch = 0x67; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x80; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x9E; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0x9F; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x9C; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x47; break; - case 0xFF5E: ch = 0xDC; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1142 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1143.cs b/mcs/class/I18N/Rare/CP1143.cs index c5cd8bd3cfd..7a898c9fc25 100644 --- a/mcs/class/I18N/Rare/CP1143.cs +++ b/mcs/class/I18N/Rare/CP1143.cs @@ -97,12 +97,11 @@ public class CP1143 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1143 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1143 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1143 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x63; break; - case 0x0024: ch = 0x67; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0xEC; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xB5; break; - case 0x005C: ch = 0x71; break; - case 0x005D: ch = 0x9F; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x51; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x43; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x47; break; - case 0x007E: ch = 0xDC; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0xCC; break; - case 0x00A7: ch = 0x4A; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x7B; break; - case 0x00C5: ch = 0x5B; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0xE0; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0x7C; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0xC0; break; - case 0x00E5: ch = 0xD0; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x79; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0x6A; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xA1; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0x20AC: ch = 0x5A; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x63; break; - case 0xFF04: ch = 0x67; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0xEC; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xB5; break; - case 0xFF3C: ch = 0x71; break; - case 0xFF3D: ch = 0x9F; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x51; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x43; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x47; break; - case 0xFF5E: ch = 0xDC; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1143 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1144.cs b/mcs/class/I18N/Rare/CP1144.cs index e869d58406e..a9ce8b844f1 100644 --- a/mcs/class/I18N/Rare/CP1144.cs +++ b/mcs/class/I18N/Rare/CP1144.cs @@ -97,12 +97,11 @@ public class CP1144 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1144 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1144 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1144 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0xB1; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0xB5; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x90; break; - case 0x005C: ch = 0x48; break; - case 0x005D: ch = 0x51; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0xDD; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x44; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x54; break; - case 0x007E: ch = 0x58; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0x7B; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0xCD; break; - case 0x00A7: ch = 0x7C; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x4A; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0xC0; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0xE0; break; - case 0x00E8: ch = 0xD0; break; - case 0x00E9: ch = 0x5A; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0xA1; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0x6A; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0x79; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0x20AC: ch = 0x9F; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0xB1; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0xB5; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x90; break; - case 0xFF3C: ch = 0x48; break; - case 0xFF3D: ch = 0x51; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0xDD; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x44; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x54; break; - case 0xFF5E: ch = 0x58; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1144 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1145.cs b/mcs/class/I18N/Rare/CP1145.cs index 2bd90fe0fcd..fc1551f7f2b 100644 --- a/mcs/class/I18N/Rare/CP1145.cs +++ b/mcs/class/I18N/Rare/CP1145.cs @@ -97,12 +97,11 @@ public class CP1145 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1145 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1145 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1145 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0xBB; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x69; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x4A; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0x5A; break; - case 0x005E: ch = 0xBA; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x4F; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xBD; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x49; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xA1; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0x5F; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x7B; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x6A; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0x20AC: ch = 0x9F; break; - case 0xFF01: ch = 0xBB; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x69; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x4A; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0x5A; break; - case 0xFF3E: ch = 0xBA; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x4F; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xBD; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1145 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1146.cs b/mcs/class/I18N/Rare/CP1146.cs index 26ec8fce476..93ba039c2aa 100644 --- a/mcs/class/I18N/Rare/CP1146.cs +++ b/mcs/class/I18N/Rare/CP1146.cs @@ -97,12 +97,11 @@ public class CP1146 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1146 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1146 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1146 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x5A; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x4A; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xB1; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0xBB; break; - case 0x005E: ch = 0xBA; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x4F; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xBC; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0x5B; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0x5F; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xA1; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xA1; break; - case 0x20AC: ch = 0x9F; break; - case 0xFF01: ch = 0x5A; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x4A; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xB1; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0xBB; break; - case 0xFF3E: ch = 0xBA; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x4F; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xBC; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1146 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1147.cs b/mcs/class/I18N/Rare/CP1147.cs index f2138b106d0..f1918271f9d 100644 --- a/mcs/class/I18N/Rare/CP1147.cs +++ b/mcs/class/I18N/Rare/CP1147.cs @@ -97,12 +97,11 @@ public class CP1147 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1147 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1147 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1147 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0xB1; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x44; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x90; break; - case 0x005C: ch = 0x48; break; - case 0x005D: ch = 0xB5; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0xA0; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x51; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x54; break; - case 0x007E: ch = 0xBD; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0x7B; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0xDD; break; - case 0x00A7: ch = 0x5A; break; - case 0x00A8: ch = 0xA1; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x4A; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0x79; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x7C; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0xE0; break; - case 0x00E8: ch = 0xD0; break; - case 0x00E9: ch = 0xC0; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0x6A; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0x20AC: ch = 0x9F; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0xB1; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x44; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x90; break; - case 0xFF3C: ch = 0x48; break; - case 0xFF3D: ch = 0xB5; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0xA0; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x51; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x54; break; - case 0xFF5E: ch = 0xBD; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1147 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1148.cs b/mcs/class/I18N/Rare/CP1148.cs index 37fa089024e..31a144cfb11 100644 --- a/mcs/class/I18N/Rare/CP1148.cs +++ b/mcs/class/I18N/Rare/CP1148.cs @@ -97,12 +97,11 @@ public class CP1148 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1148 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1148 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1148 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x4A; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0x5A; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA1; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0x20AC: ch = 0x9F; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x4A; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0x5A; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA1; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1148 [Serializable] diff --git a/mcs/class/I18N/Rare/CP1149.cs b/mcs/class/I18N/Rare/CP1149.cs index f4cfda6de61..d2be053a145 100644 --- a/mcs/class/I18N/Rare/CP1149.cs +++ b/mcs/class/I18N/Rare/CP1149.cs @@ -97,12 +97,11 @@ public class CP1149 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1149 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1149 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP1149 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0xAC; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xAE; break; - case 0x005C: ch = 0xBE; break; - case 0x005D: ch = 0x9E; break; - case 0x005E: ch = 0xEC; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x8C; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x8E; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x9C; break; - case 0x007E: ch = 0xCC; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xE0; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x5A; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0x7C; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0x5F; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0x4A; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0xD0; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x79; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xA1; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0xC0; break; - case 0x00FF: ch = 0xDF; break; - case 0x203E: ch = 0xBC; break; - case 0x20AC: ch = 0x9F; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0xAC; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xAE; break; - case 0xFF3C: ch = 0xBE; break; - case 0xFF3D: ch = 0x9E; break; - case 0xFF3E: ch = 0xEC; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x8C; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x8E; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x9C; break; - case 0xFF5E: ch = 0xCC; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1149 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20273.cs b/mcs/class/I18N/Rare/CP20273.cs index 322bb8ceb2f..87407d2ebfe 100644 --- a/mcs/class/I18N/Rare/CP20273.cs +++ b/mcs/class/I18N/Rare/CP20273.cs @@ -97,12 +97,11 @@ public class CP20273 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20273 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20273 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP20273 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0xB5; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x63; break; - case 0x005C: ch = 0xEC; break; - case 0x005D: ch = 0xFC; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x43; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0xDC; break; - case 0x007E: ch = 0x59; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0xCC; break; - case 0x00A7: ch = 0x7C; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x4A; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xE0; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0x5A; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0xA1; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0xC0; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0x6A; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xD0; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0xAC; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0xB5; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x63; break; - case 0xFF3C: ch = 0xEC; break; - case 0xFF3D: ch = 0xFC; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x43; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0xDC; break; - case 0xFF5E: ch = 0x59; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20273 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20277.cs b/mcs/class/I18N/Rare/CP20277.cs index 96b11bc6ddd..1f9110245b6 100644 --- a/mcs/class/I18N/Rare/CP20277.cs +++ b/mcs/class/I18N/Rare/CP20277.cs @@ -97,12 +97,11 @@ public class CP20277 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20277 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20277 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP20277 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x4A; break; - case 0x0024: ch = 0x67; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x80; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x9E; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0x9F; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x9C; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x47; break; - case 0x007E: ch = 0xDC; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x5A; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x70; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x5B; break; - case 0x00C6: ch = 0x7B; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x7C; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0xD0; break; - case 0x00E6: ch = 0xC0; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x6A; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xA1; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0xAC; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x4A; break; - case 0xFF04: ch = 0x67; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x80; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x9E; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0x9F; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x9C; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x47; break; - case 0xFF5E: ch = 0xDC; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20277 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20278.cs b/mcs/class/I18N/Rare/CP20278.cs index 04b0a6882e7..eec15bc9ebd 100644 --- a/mcs/class/I18N/Rare/CP20278.cs +++ b/mcs/class/I18N/Rare/CP20278.cs @@ -97,12 +97,11 @@ public class CP20278 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20278 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20278 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP20278 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x63; break; - case 0x0024: ch = 0x67; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0xEC; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xB5; break; - case 0x005C: ch = 0x71; break; - case 0x005D: ch = 0x9F; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x51; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x43; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x47; break; - case 0x007E: ch = 0xDC; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x5A; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0xCC; break; - case 0x00A7: ch = 0x4A; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x7B; break; - case 0x00C5: ch = 0x5B; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0xE0; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0x7C; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0xC0; break; - case 0x00E5: ch = 0xD0; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x79; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0x6A; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xA1; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0xAC; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x63; break; - case 0xFF04: ch = 0x67; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0xEC; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xB5; break; - case 0xFF3C: ch = 0x71; break; - case 0xFF3D: ch = 0x9F; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x51; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x43; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x47; break; - case 0xFF5E: ch = 0xDC; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20278 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20280.cs b/mcs/class/I18N/Rare/CP20280.cs index 9e47298def9..825c16af622 100644 --- a/mcs/class/I18N/Rare/CP20280.cs +++ b/mcs/class/I18N/Rare/CP20280.cs @@ -97,12 +97,11 @@ public class CP20280 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20280 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20280 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP20280 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0xB1; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0xB5; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x90; break; - case 0x005C: ch = 0x48; break; - case 0x005D: ch = 0x51; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0xDD; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x44; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x54; break; - case 0x007E: ch = 0x58; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0x7B; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0xCD; break; - case 0x00A7: ch = 0x7C; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x4A; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0xC0; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0xE0; break; - case 0x00E8: ch = 0xD0; break; - case 0x00E9: ch = 0x5A; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0xA1; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0x6A; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0x79; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0xAC; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0xB1; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0xB5; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x90; break; - case 0xFF3C: ch = 0x48; break; - case 0xFF3D: ch = 0x51; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0xDD; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x44; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x54; break; - case 0xFF5E: ch = 0x58; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20280 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20284.cs b/mcs/class/I18N/Rare/CP20284.cs index 49a2c068e3d..7c338eebf3a 100644 --- a/mcs/class/I18N/Rare/CP20284.cs +++ b/mcs/class/I18N/Rare/CP20284.cs @@ -97,12 +97,11 @@ public class CP20284 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20284 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20284 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP20284 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0xBB; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x69; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x4A; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0x5A; break; - case 0x005E: ch = 0xBA; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x4F; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xBD; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x49; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xA1; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0x5F; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x7B; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x6A; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0xAC; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0xBB; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x69; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x4A; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0x5A; break; - case 0xFF3E: ch = 0xBA; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x4F; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xBD; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20284 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20285.cs b/mcs/class/I18N/Rare/CP20285.cs index b0e9dfdb48b..027df952077 100644 --- a/mcs/class/I18N/Rare/CP20285.cs +++ b/mcs/class/I18N/Rare/CP20285.cs @@ -97,12 +97,11 @@ public class CP20285 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20285 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20285 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP20285 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x5A; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x4A; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xB1; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0xBB; break; - case 0x005E: ch = 0xBA; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x4F; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xBC; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0x5B; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0x5F; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xA1; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0xAC; break; - case 0x203E: ch = 0xA1; break; - case 0xFF01: ch = 0x5A; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x4A; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xB1; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0xBB; break; - case 0xFF3E: ch = 0xBA; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x4F; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xBC; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20285 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20290.cs b/mcs/class/I18N/Rare/CP20290.cs index 48d33fab22d..1c041ffa1bc 100644 --- a/mcs/class/I18N/Rare/CP20290.cs +++ b/mcs/class/I18N/Rare/CP20290.cs @@ -97,12 +97,11 @@ public class CP20290 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20290 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20290 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -531,394 +530,6 @@ public class CP20290 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x5A; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0xE0; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x70; break; - case 0x005C: ch = 0xB2; break; - case 0x005D: ch = 0x80; break; - case 0x005E: ch = 0xB0; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - ch += 0x0001; - break; - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - ch += 0x0008; - break; - case 0x0071: ch = 0x8B; break; - case 0x0072: ch = 0x9B; break; - case 0x0073: ch = 0xAB; break; - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x003F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x4F; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA0; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A2: ch = 0xB1; break; - case 0x00A3: ch = 0x4A; break; - case 0x00A5: ch = 0x5B; break; - case 0x00AC: ch = 0x5F; break; - case 0x203E: ch = 0xA1; break; - case 0xFF01: ch = 0x5A; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0xE0; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x70; break; - case 0xFF3C: ch = 0xB2; break; - case 0xFF3D: ch = 0x80; break; - case 0xFF3E: ch = 0xB0; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - ch -= 0xFEDF; - break; - case 0xFF49: - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - ch -= 0xFED8; - break; - case 0xFF51: ch = 0x8B; break; - case 0xFF52: ch = 0x9B; break; - case 0xFF53: ch = 0xAB; break; - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEA1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x4F; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA0; break; - case 0xFF61: - case 0xFF62: - case 0xFF63: - case 0xFF64: - case 0xFF65: - case 0xFF66: - case 0xFF67: - case 0xFF68: - case 0xFF69: - ch -= 0xFF20; - break; - case 0xFF6A: - case 0xFF6B: - case 0xFF6C: - case 0xFF6D: - case 0xFF6E: - case 0xFF6F: - ch -= 0xFF19; - break; - case 0xFF70: ch = 0x58; break; - case 0xFF71: - case 0xFF72: - case 0xFF73: - case 0xFF74: - case 0xFF75: - case 0xFF76: - case 0xFF77: - case 0xFF78: - case 0xFF79: - case 0xFF7A: - ch -= 0xFEF0; - break; - case 0xFF7B: - case 0xFF7C: - case 0xFF7D: - case 0xFF7E: - case 0xFF7F: - case 0xFF80: - case 0xFF81: - case 0xFF82: - case 0xFF83: - case 0xFF84: - case 0xFF85: - case 0xFF86: - case 0xFF87: - case 0xFF88: - case 0xFF89: - ch -= 0xFEEF; - break; - case 0xFF8A: ch = 0x9D; break; - case 0xFF8B: ch = 0x9E; break; - case 0xFF8C: ch = 0x9F; break; - case 0xFF8D: - case 0xFF8E: - case 0xFF8F: - case 0xFF90: - case 0xFF91: - case 0xFF92: - case 0xFF93: - case 0xFF94: - case 0xFF95: - ch -= 0xFEEB; - break; - case 0xFF96: - case 0xFF97: - case 0xFF98: - case 0xFF99: - ch -= 0xFEEA; - break; - case 0xFF9A: - case 0xFF9B: - case 0xFF9C: - case 0xFF9D: - case 0xFF9E: - case 0xFF9F: - ch -= 0xFEE0; - break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20290 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20297.cs b/mcs/class/I18N/Rare/CP20297.cs index 57d88adb5a8..e79bb349340 100644 --- a/mcs/class/I18N/Rare/CP20297.cs +++ b/mcs/class/I18N/Rare/CP20297.cs @@ -97,12 +97,11 @@ public class CP20297 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20297 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20297 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP20297 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0xB1; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x44; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x90; break; - case 0x005C: ch = 0x48; break; - case 0x005D: ch = 0xB5; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0xA0; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x51; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x54; break; - case 0x007E: ch = 0xBD; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0x7B; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0xDD; break; - case 0x00A7: ch = 0x5A; break; - case 0x00A8: ch = 0xA1; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x4A; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0x79; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x7C; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0xE0; break; - case 0x00E8: ch = 0xD0; break; - case 0x00E9: ch = 0xC0; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0x6A; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0xAC; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0xB1; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x44; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x90; break; - case 0xFF3C: ch = 0x48; break; - case 0xFF3D: ch = 0xB5; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0xA0; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x51; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x54; break; - case 0xFF5E: ch = 0xBD; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20297 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20420.cs b/mcs/class/I18N/Rare/CP20420.cs index c7d27e54535..5945c9a14c1 100644 --- a/mcs/class/I18N/Rare/CP20420.cs +++ b/mcs/class/I18N/Rare/CP20420.cs @@ -97,12 +97,11 @@ public class CP20420 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20420 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20420 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -635,498 +634,6 @@ public class CP20420 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x5A; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005F: ch = 0x6D; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007C: ch = 0x4F; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A2: ch = 0x4A; break; - case 0x00A6: ch = 0x6A; break; - case 0x00AC: ch = 0x5F; break; - case 0x00AD: ch = 0xCA; break; - case 0x00D7: ch = 0xE0; break; - case 0x00F7: ch = 0xA1; break; - case 0x060C: ch = 0x79; break; - case 0x061B: ch = 0xC0; break; - case 0x061F: ch = 0xD0; break; - case 0x0621: ch = 0x46; break; - case 0x0622: ch = 0x47; break; - case 0x0623: ch = 0x49; break; - case 0x0624: ch = 0x52; break; - case 0x0625: ch = 0x56; break; - case 0x0626: ch = 0x55; break; - case 0x0627: ch = 0x56; break; - case 0x0628: ch = 0x58; break; - case 0x0629: ch = 0x62; break; - case 0x062A: ch = 0x63; break; - case 0x062B: ch = 0x65; break; - case 0x062C: ch = 0x67; break; - case 0x062D: ch = 0x69; break; - case 0x062E: ch = 0x71; break; - case 0x062F: - case 0x0630: - case 0x0631: - case 0x0632: - case 0x0633: - ch -= 0x05BC; - break; - case 0x0634: ch = 0x80; break; - case 0x0635: ch = 0x8B; break; - case 0x0636: ch = 0x8D; break; - case 0x0637: ch = 0x8F; break; - case 0x0638: ch = 0x90; break; - case 0x0639: ch = 0x9A; break; - case 0x063A: ch = 0x9E; break; - case 0x0640: ch = 0x44; break; - case 0x0641: ch = 0xAB; break; - case 0x0642: ch = 0xAD; break; - case 0x0643: ch = 0xAF; break; - case 0x0644: ch = 0xB1; break; - case 0x0645: ch = 0xBB; break; - case 0x0646: ch = 0xBD; break; - case 0x0647: ch = 0xBF; break; - case 0x0648: ch = 0xCF; break; - case 0x0649: ch = 0xDA; break; - case 0x064A: ch = 0xDC; break; - case 0x0651: ch = 0x42; break; - case 0x0660: ch = 0xDF; break; - case 0x0661: ch = 0xEA; break; - case 0x0662: ch = 0xEB; break; - case 0x0663: ch = 0xED; break; - case 0x0664: ch = 0xEE; break; - case 0x0665: ch = 0xEF; break; - case 0x0666: - case 0x0667: - case 0x0668: - case 0x0669: - ch -= 0x056B; - break; - case 0x066A: ch = 0x6C; break; - case 0x066B: ch = 0x6B; break; - case 0x066C: ch = 0x4B; break; - case 0x066D: ch = 0x5C; break; - case 0x200B: ch = 0x45; break; - case 0xFE7C: ch = 0x42; break; - case 0xFE7D: ch = 0x43; break; - case 0xFE80: - case 0xFE81: - case 0xFE82: - case 0xFE83: - ch -= 0xFE3A; - break; - case 0xFE84: ch = 0x51; break; - case 0xFE85: ch = 0x52; break; - case 0xFE86: ch = 0x52; break; - case 0xFE87: ch = 0x56; break; - case 0xFE88: ch = 0x57; break; - case 0xFE8B: ch = 0x55; break; - case 0xFE8C: - case 0xFE8D: - case 0xFE8E: - case 0xFE8F: - ch -= 0xFE37; - break; - case 0xFE90: ch = 0x58; break; - case 0xFE91: ch = 0x59; break; - case 0xFE92: ch = 0x59; break; - case 0xFE93: ch = 0x62; break; - case 0xFE94: ch = 0x62; break; - case 0xFE95: ch = 0x63; break; - case 0xFE96: ch = 0x63; break; - case 0xFE97: ch = 0x64; break; - case 0xFE98: ch = 0x64; break; - case 0xFE99: ch = 0x65; break; - case 0xFE9A: ch = 0x65; break; - case 0xFE9B: ch = 0x66; break; - case 0xFE9C: ch = 0x66; break; - case 0xFE9D: ch = 0x67; break; - case 0xFE9E: ch = 0x67; break; - case 0xFE9F: ch = 0x68; break; - case 0xFEA0: ch = 0x68; break; - case 0xFEA1: ch = 0x69; break; - case 0xFEA2: ch = 0x69; break; - case 0xFEA3: ch = 0x70; break; - case 0xFEA4: ch = 0x70; break; - case 0xFEA5: ch = 0x71; break; - case 0xFEA6: ch = 0x71; break; - case 0xFEA7: ch = 0x72; break; - case 0xFEA8: ch = 0x72; break; - case 0xFEA9: ch = 0x73; break; - case 0xFEAA: ch = 0x73; break; - case 0xFEAB: ch = 0x74; break; - case 0xFEAC: ch = 0x74; break; - case 0xFEAD: ch = 0x75; break; - case 0xFEAE: ch = 0x75; break; - case 0xFEAF: ch = 0x76; break; - case 0xFEB0: ch = 0x76; break; - case 0xFEB1: ch = 0x77; break; - case 0xFEB2: ch = 0x77; break; - case 0xFEB3: ch = 0x78; break; - case 0xFEB4: ch = 0x78; break; - case 0xFEB5: ch = 0x80; break; - case 0xFEB6: ch = 0x80; break; - case 0xFEB7: ch = 0x8A; break; - case 0xFEB8: ch = 0x8A; break; - case 0xFEB9: ch = 0x8B; break; - case 0xFEBA: ch = 0x8B; break; - case 0xFEBB: ch = 0x8C; break; - case 0xFEBC: ch = 0x8C; break; - case 0xFEBD: ch = 0x8D; break; - case 0xFEBE: ch = 0x8D; break; - case 0xFEBF: ch = 0x8E; break; - case 0xFEC0: ch = 0x8E; break; - case 0xFEC1: ch = 0x8F; break; - case 0xFEC2: ch = 0x8F; break; - case 0xFEC3: ch = 0x8F; break; - case 0xFEC4: ch = 0x8F; break; - case 0xFEC5: ch = 0x90; break; - case 0xFEC6: ch = 0x90; break; - case 0xFEC7: ch = 0x90; break; - case 0xFEC8: ch = 0x90; break; - case 0xFEC9: - case 0xFECA: - case 0xFECB: - case 0xFECC: - case 0xFECD: - case 0xFECE: - case 0xFECF: - ch -= 0xFE2F; - break; - case 0xFED0: ch = 0xAA; break; - case 0xFED1: ch = 0xAB; break; - case 0xFED2: ch = 0xAB; break; - case 0xFED3: ch = 0xAC; break; - case 0xFED4: ch = 0xAC; break; - case 0xFED5: ch = 0xAD; break; - case 0xFED6: ch = 0xAD; break; - case 0xFED7: ch = 0xAE; break; - case 0xFED8: ch = 0xAE; break; - case 0xFED9: ch = 0xAF; break; - case 0xFEDA: ch = 0xAF; break; - case 0xFEDB: ch = 0xB0; break; - case 0xFEDC: ch = 0xB0; break; - case 0xFEDD: ch = 0xB1; break; - case 0xFEDE: ch = 0xB1; break; - case 0xFEDF: ch = 0xBA; break; - case 0xFEE0: ch = 0xBA; break; - case 0xFEE1: ch = 0xBB; break; - case 0xFEE2: ch = 0xBB; break; - case 0xFEE3: ch = 0xBC; break; - case 0xFEE4: ch = 0xBC; break; - case 0xFEE5: ch = 0xBD; break; - case 0xFEE6: ch = 0xBD; break; - case 0xFEE7: ch = 0xBE; break; - case 0xFEE8: ch = 0xBE; break; - case 0xFEE9: ch = 0xBF; break; - case 0xFEEA: ch = 0xBF; break; - case 0xFEEB: ch = 0xCB; break; - case 0xFEEC: ch = 0xCD; break; - case 0xFEED: ch = 0xCF; break; - case 0xFEEE: ch = 0xCF; break; - case 0xFEEF: - case 0xFEF0: - case 0xFEF1: - case 0xFEF2: - case 0xFEF3: - ch -= 0xFE15; - break; - case 0xFEF4: ch = 0xDE; break; - case 0xFEF5: - case 0xFEF6: - case 0xFEF7: - case 0xFEF8: - ch -= 0xFE43; - break; - case 0xFEF9: ch = 0xB8; break; - case 0xFEFA: ch = 0xB9; break; - case 0xFEFB: ch = 0xB8; break; - case 0xFEFC: ch = 0xB9; break; - case 0xFF01: ch = 0x5A; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5C: ch = 0x4F; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20420 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20424.cs b/mcs/class/I18N/Rare/CP20424.cs index 8dcd41c6597..87f27f7aea0 100644 --- a/mcs/class/I18N/Rare/CP20424.cs +++ b/mcs/class/I18N/Rare/CP20424.cs @@ -97,12 +97,11 @@ public class CP20424 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20424 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20424 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -513,376 +512,6 @@ public class CP20424 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x5A; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xBA; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0xBB; break; - case 0x005E: ch = 0xB0; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x4F; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA1; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x74; break; - case 0x00A2: ch = 0x4A; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0x5F; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00D7: ch = 0xBF; break; - case 0x00F7: ch = 0xE1; break; - case 0x05D0: - case 0x05D1: - case 0x05D2: - case 0x05D3: - case 0x05D4: - case 0x05D5: - case 0x05D6: - case 0x05D7: - case 0x05D8: - ch -= 0x058F; - break; - case 0x05D9: - case 0x05DA: - case 0x05DB: - case 0x05DC: - case 0x05DD: - case 0x05DE: - case 0x05DF: - case 0x05E0: - case 0x05E1: - ch -= 0x0588; - break; - case 0x05E2: - case 0x05E3: - case 0x05E4: - case 0x05E5: - case 0x05E6: - case 0x05E7: - case 0x05E8: - case 0x05E9: - ch -= 0x0580; - break; - case 0x05EA: ch = 0x71; break; - case 0x2017: ch = 0x78; break; - case 0x2022: ch = 0xB3; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x5A; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xBA; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0xBB; break; - case 0xFF3E: ch = 0xB0; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x4F; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA1; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20424 [Serializable] diff --git a/mcs/class/I18N/Rare/CP20871.cs b/mcs/class/I18N/Rare/CP20871.cs index a7af68d1562..3407fe73431 100644 --- a/mcs/class/I18N/Rare/CP20871.cs +++ b/mcs/class/I18N/Rare/CP20871.cs @@ -97,12 +97,11 @@ public class CP20871 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP20871 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP20871 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP20871 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0xAC; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xAE; break; - case 0x005C: ch = 0xBE; break; - case 0x005D: ch = 0x9E; break; - case 0x005E: ch = 0xEC; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x8C; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0x8E; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0x9C; break; - case 0x007E: ch = 0xCC; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xE0; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x5A; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0x7C; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0x5F; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0x4A; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0xD0; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x79; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xA1; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0xC0; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0x7C; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0xAC; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xAE; break; - case 0xFF3C: ch = 0xBE; break; - case 0xFF3D: ch = 0x9E; break; - case 0xFF3E: ch = 0xEC; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x8C; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0x8E; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0x9C; break; - case 0xFF5E: ch = 0xCC; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP20871 [Serializable] diff --git a/mcs/class/I18N/Rare/CP21025.cs b/mcs/class/I18N/Rare/CP21025.cs index 39e243b1b9b..4f58a3fc531 100644 --- a/mcs/class/I18N/Rare/CP21025.cs +++ b/mcs/class/I18N/Rare/CP21025.cs @@ -97,12 +97,11 @@ public class CP21025 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP21025 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP21025 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -557,420 +556,6 @@ public class CP21025 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x4A; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0x5A; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x6A; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA1; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A7: ch = 0xE1; break; - case 0x00AD: ch = 0x73; break; - case 0x0401: ch = 0x63; break; - case 0x0402: ch = 0x59; break; - case 0x0403: ch = 0x62; break; - case 0x0404: - case 0x0405: - case 0x0406: - case 0x0407: - case 0x0408: - case 0x0409: - ch -= 0x03A0; - break; - case 0x040A: ch = 0x70; break; - case 0x040B: ch = 0x71; break; - case 0x040C: ch = 0x72; break; - case 0x040E: ch = 0x74; break; - case 0x040F: ch = 0x75; break; - case 0x0410: ch = 0xB9; break; - case 0x0411: ch = 0xBA; break; - case 0x0412: ch = 0xED; break; - case 0x0413: ch = 0xBF; break; - case 0x0414: ch = 0xBC; break; - case 0x0415: ch = 0xBD; break; - case 0x0416: ch = 0xEC; break; - case 0x0417: ch = 0xFA; break; - case 0x0418: - case 0x0419: - case 0x041A: - case 0x041B: - case 0x041C: - ch -= 0x034D; - break; - case 0x041D: ch = 0xDA; break; - case 0x041E: ch = 0xDB; break; - case 0x041F: ch = 0xDC; break; - case 0x0420: ch = 0xDE; break; - case 0x0421: ch = 0xDF; break; - case 0x0422: ch = 0xEA; break; - case 0x0423: ch = 0xEB; break; - case 0x0424: ch = 0xBE; break; - case 0x0425: ch = 0xCA; break; - case 0x0426: ch = 0xBB; break; - case 0x0427: ch = 0xFE; break; - case 0x0428: ch = 0xFB; break; - case 0x0429: ch = 0xFD; break; - case 0x042A: ch = 0x57; break; - case 0x042B: ch = 0xEF; break; - case 0x042C: ch = 0xEE; break; - case 0x042D: ch = 0xFC; break; - case 0x042E: ch = 0xB8; break; - case 0x042F: ch = 0xDD; break; - case 0x0430: ch = 0x77; break; - case 0x0431: ch = 0x78; break; - case 0x0432: ch = 0xAF; break; - case 0x0433: ch = 0x8D; break; - case 0x0434: ch = 0x8A; break; - case 0x0435: ch = 0x8B; break; - case 0x0436: ch = 0xAE; break; - case 0x0437: ch = 0xB2; break; - case 0x0438: ch = 0x8F; break; - case 0x0439: ch = 0x90; break; - case 0x043A: - case 0x043B: - case 0x043C: - case 0x043D: - case 0x043E: - case 0x043F: - ch -= 0x03A0; - break; - case 0x0440: - case 0x0441: - case 0x0442: - case 0x0443: - ch -= 0x0396; - break; - case 0x0444: ch = 0x8C; break; - case 0x0445: ch = 0x8E; break; - case 0x0446: ch = 0x80; break; - case 0x0447: ch = 0xB6; break; - case 0x0448: ch = 0xB3; break; - case 0x0449: ch = 0xB5; break; - case 0x044A: ch = 0xB7; break; - case 0x044B: ch = 0xB1; break; - case 0x044C: ch = 0xB0; break; - case 0x044D: ch = 0xB4; break; - case 0x044E: ch = 0x76; break; - case 0x044F: ch = 0xA0; break; - case 0x0451: ch = 0x44; break; - case 0x0452: ch = 0x42; break; - case 0x0453: ch = 0x43; break; - case 0x0454: - case 0x0455: - case 0x0456: - case 0x0457: - case 0x0458: - ch -= 0x040F; - break; - case 0x0459: - case 0x045A: - case 0x045B: - case 0x045C: - ch -= 0x0408; - break; - case 0x045E: ch = 0x55; break; - case 0x045F: ch = 0x56; break; - case 0x2116: ch = 0x58; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x4A; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0x5A; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x6A; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA1; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP21025 [Serializable] diff --git a/mcs/class/I18N/Rare/CP37.cs b/mcs/class/I18N/Rare/CP37.cs index 025a16c937d..ae35396cec0 100644 --- a/mcs/class/I18N/Rare/CP37.cs +++ b/mcs/class/I18N/Rare/CP37.cs @@ -97,12 +97,11 @@ public class CP37 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP37 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP37 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP37 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x5A; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0xBA; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0xBB; break; - case 0x005E: ch = 0xB0; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x4F; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA1; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0x4A; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0x5F; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0xAC; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x5A; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0xBA; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0xBB; break; - case 0xFF3E: ch = 0xB0; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x4F; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA1; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP37 [Serializable] diff --git a/mcs/class/I18N/Rare/CP500.cs b/mcs/class/I18N/Rare/CP500.cs index 3988946efea..4a34c40ed36 100644 --- a/mcs/class/I18N/Rare/CP500.cs +++ b/mcs/class/I18N/Rare/CP500.cs @@ -97,12 +97,11 @@ public class CP500 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP500 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP500 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -547,410 +546,6 @@ public class CP500 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x00B6: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x4A; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0x5A; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0xBB; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA1; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A1: ch = 0xAA; break; - case 0x00A2: ch = 0xB0; break; - case 0x00A3: ch = 0xB1; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A5: ch = 0xB2; break; - case 0x00A6: ch = 0x6A; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00A9: ch = 0xB4; break; - case 0x00AA: ch = 0x9A; break; - case 0x00AB: ch = 0x8A; break; - case 0x00AC: ch = 0xBA; break; - case 0x00AD: ch = 0xCA; break; - case 0x00AE: ch = 0xAF; break; - case 0x00AF: ch = 0xBC; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0x8F; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B5: ch = 0xA0; break; - case 0x00B7: ch = 0xB3; break; - case 0x00B8: ch = 0x9D; break; - case 0x00B9: ch = 0xDA; break; - case 0x00BA: ch = 0x9B; break; - case 0x00BB: ch = 0x8B; break; - case 0x00BC: ch = 0xB7; break; - case 0x00BD: ch = 0xB8; break; - case 0x00BE: ch = 0xB9; break; - case 0x00BF: ch = 0xAB; break; - case 0x00C0: ch = 0x64; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C3: ch = 0x66; break; - case 0x00C4: ch = 0x63; break; - case 0x00C5: ch = 0x67; break; - case 0x00C6: ch = 0x9E; break; - case 0x00C7: ch = 0x68; break; - case 0x00C8: ch = 0x74; break; - case 0x00C9: ch = 0x71; break; - case 0x00CA: ch = 0x72; break; - case 0x00CB: ch = 0x73; break; - case 0x00CC: ch = 0x78; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00CF: ch = 0x77; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D1: ch = 0x69; break; - case 0x00D2: ch = 0xED; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D5: ch = 0xEF; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00D8: ch = 0x80; break; - case 0x00D9: ch = 0xFD; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DB: ch = 0xFB; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DE: ch = 0xAE; break; - case 0x00DF: ch = 0x59; break; - case 0x00E0: ch = 0x44; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E3: ch = 0x46; break; - case 0x00E4: ch = 0x43; break; - case 0x00E5: ch = 0x47; break; - case 0x00E6: ch = 0x9C; break; - case 0x00E7: ch = 0x48; break; - case 0x00E8: ch = 0x54; break; - case 0x00E9: ch = 0x51; break; - case 0x00EA: ch = 0x52; break; - case 0x00EB: ch = 0x53; break; - case 0x00EC: ch = 0x58; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00EF: ch = 0x57; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F1: ch = 0x49; break; - case 0x00F2: ch = 0xCD; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F5: ch = 0xCF; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00F8: ch = 0x70; break; - case 0x00F9: ch = 0xDD; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FB: ch = 0xDB; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x00FE: ch = 0x8E; break; - case 0x00FF: ch = 0xDF; break; - case 0x0110: ch = 0xAC; break; - case 0x203E: ch = 0xBC; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x4A; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0x5A; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0xBB; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA1; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP500 [Serializable] diff --git a/mcs/class/I18N/Rare/CP708.cs b/mcs/class/I18N/Rare/CP708.cs index 0b2810b8de5..43f4cb02200 100644 --- a/mcs/class/I18N/Rare/CP708.cs +++ b/mcs/class/I18N/Rare/CP708.cs @@ -97,12 +97,11 @@ public class CP708 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP708 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP708 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -374,238 +373,6 @@ public class CP708 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 161) switch(ch) - { - case 0x00A4: - case 0x00AD: - break; - case 0x060C: ch = 0xAC; break; - case 0x061B: ch = 0xBB; break; - case 0x061F: ch = 0xBF; break; - case 0x0621: - case 0x0622: - case 0x0623: - case 0x0624: - case 0x0625: - case 0x0626: - case 0x0627: - case 0x0628: - case 0x0629: - case 0x062A: - case 0x062B: - case 0x062C: - case 0x062D: - case 0x062E: - case 0x062F: - case 0x0630: - case 0x0631: - case 0x0632: - case 0x0633: - case 0x0634: - case 0x0635: - case 0x0636: - case 0x0637: - case 0x0638: - case 0x0639: - case 0x063A: - ch -= 0x0560; - break; - case 0x0640: - case 0x0641: - case 0x0642: - case 0x0643: - case 0x0644: - case 0x0645: - case 0x0646: - case 0x0647: - case 0x0648: - case 0x0649: - case 0x064A: - case 0x064B: - case 0x064C: - case 0x064D: - case 0x064E: - case 0x064F: - case 0x0650: - case 0x0651: - case 0x0652: - ch -= 0x0560; - break; - case 0x0660: - case 0x0661: - case 0x0662: - case 0x0663: - case 0x0664: - case 0x0665: - case 0x0666: - case 0x0667: - case 0x0668: - case 0x0669: - ch -= 0x0630; - break; - case 0x066A: ch = 0x25; break; - case 0x066B: ch = 0x2C; break; - case 0x066C: ch = 0x2E; break; - case 0x066D: ch = 0x2A; break; - case 0xFE70: ch = 0xEB; break; - case 0xFE71: ch = 0xEB; break; - case 0xFE72: ch = 0xEC; break; - case 0xFE74: ch = 0xED; break; - case 0xFE76: ch = 0xEE; break; - case 0xFE77: ch = 0xEE; break; - case 0xFE78: ch = 0xEF; break; - case 0xFE79: ch = 0xEF; break; - case 0xFE7A: ch = 0xF0; break; - case 0xFE7B: ch = 0xF0; break; - case 0xFE7C: ch = 0xF1; break; - case 0xFE7D: ch = 0xF1; break; - case 0xFE7E: ch = 0xF2; break; - case 0xFE7F: ch = 0xF2; break; - case 0xFE80: ch = 0xC1; break; - case 0xFE81: ch = 0xC2; break; - case 0xFE82: ch = 0xC2; break; - case 0xFE83: ch = 0xC3; break; - case 0xFE84: ch = 0xC3; break; - case 0xFE85: ch = 0xC4; break; - case 0xFE86: ch = 0xC4; break; - case 0xFE87: ch = 0xC5; break; - case 0xFE88: ch = 0xC5; break; - case 0xFE89: ch = 0xC6; break; - case 0xFE8A: ch = 0xC6; break; - case 0xFE8B: ch = 0xC6; break; - case 0xFE8C: ch = 0xC6; break; - case 0xFE8D: ch = 0xC7; break; - case 0xFE8E: ch = 0xC7; break; - case 0xFE8F: ch = 0xC8; break; - case 0xFE90: ch = 0xC8; break; - case 0xFE91: ch = 0xC8; break; - case 0xFE92: ch = 0xC8; break; - case 0xFE93: ch = 0xC9; break; - case 0xFE94: ch = 0xC9; break; - case 0xFE95: ch = 0xCA; break; - case 0xFE96: ch = 0xCA; break; - case 0xFE97: ch = 0xCA; break; - case 0xFE98: ch = 0xCA; break; - case 0xFE99: ch = 0xCB; break; - case 0xFE9A: ch = 0xCB; break; - case 0xFE9B: ch = 0xCB; break; - case 0xFE9C: ch = 0xCB; break; - case 0xFE9D: ch = 0xCC; break; - case 0xFE9E: ch = 0xCC; break; - case 0xFE9F: ch = 0xCC; break; - case 0xFEA0: ch = 0xCC; break; - case 0xFEA1: ch = 0xCD; break; - case 0xFEA2: ch = 0xCD; break; - case 0xFEA3: ch = 0xCD; break; - case 0xFEA4: ch = 0xCD; break; - case 0xFEA5: ch = 0xCE; break; - case 0xFEA6: ch = 0xCE; break; - case 0xFEA7: ch = 0xCE; break; - case 0xFEA8: ch = 0xCE; break; - case 0xFEA9: ch = 0xCF; break; - case 0xFEAA: ch = 0xCF; break; - case 0xFEAB: ch = 0xD0; break; - case 0xFEAC: ch = 0xD0; break; - case 0xFEAD: ch = 0xD1; break; - case 0xFEAE: ch = 0xD1; break; - case 0xFEAF: ch = 0xD2; break; - case 0xFEB0: ch = 0xD2; break; - case 0xFEB1: ch = 0xD3; break; - case 0xFEB2: ch = 0xD3; break; - case 0xFEB3: ch = 0xD3; break; - case 0xFEB4: ch = 0xD3; break; - case 0xFEB5: ch = 0xD4; break; - case 0xFEB6: ch = 0xD4; break; - case 0xFEB7: ch = 0xD4; break; - case 0xFEB8: ch = 0xD4; break; - case 0xFEB9: ch = 0xD5; break; - case 0xFEBA: ch = 0xD5; break; - case 0xFEBB: ch = 0xD5; break; - case 0xFEBC: ch = 0xD5; break; - case 0xFEBD: ch = 0xD6; break; - case 0xFEBE: ch = 0xD6; break; - case 0xFEBF: ch = 0xD6; break; - case 0xFEC0: ch = 0xD6; break; - case 0xFEC1: ch = 0xD7; break; - case 0xFEC2: ch = 0xD7; break; - case 0xFEC3: ch = 0xD7; break; - case 0xFEC4: ch = 0xD7; break; - case 0xFEC5: ch = 0xD8; break; - case 0xFEC6: ch = 0xD8; break; - case 0xFEC7: ch = 0xD8; break; - case 0xFEC8: ch = 0xD8; break; - case 0xFEC9: ch = 0xD9; break; - case 0xFECA: ch = 0xD9; break; - case 0xFECB: ch = 0xD9; break; - case 0xFECC: ch = 0xD9; break; - case 0xFECD: ch = 0xDA; break; - case 0xFECE: ch = 0xDA; break; - case 0xFECF: ch = 0xDA; break; - case 0xFED0: ch = 0xDA; break; - case 0xFED1: ch = 0xE1; break; - case 0xFED2: ch = 0xE1; break; - case 0xFED3: ch = 0xE1; break; - case 0xFED4: ch = 0xE1; break; - case 0xFED5: ch = 0xE2; break; - case 0xFED6: ch = 0xE2; break; - case 0xFED7: ch = 0xE2; break; - case 0xFED8: ch = 0xE2; break; - case 0xFED9: ch = 0xE3; break; - case 0xFEDA: ch = 0xE3; break; - case 0xFEDB: ch = 0xE3; break; - case 0xFEDC: ch = 0xE3; break; - case 0xFEDD: ch = 0xE4; break; - case 0xFEDE: ch = 0xE4; break; - case 0xFEDF: ch = 0xE4; break; - case 0xFEE0: ch = 0xE4; break; - case 0xFEE1: ch = 0xE5; break; - case 0xFEE2: ch = 0xE5; break; - case 0xFEE3: ch = 0xE5; break; - case 0xFEE4: ch = 0xE5; break; - case 0xFEE5: ch = 0xE6; break; - case 0xFEE6: ch = 0xE6; break; - case 0xFEE7: ch = 0xE6; break; - case 0xFEE8: ch = 0xE6; break; - case 0xFEE9: ch = 0xE7; break; - case 0xFEEA: ch = 0xE7; break; - case 0xFEEB: ch = 0xE7; break; - case 0xFEEC: ch = 0xE7; break; - case 0xFEED: ch = 0xE8; break; - case 0xFEEE: ch = 0xE8; break; - case 0xFEEF: ch = 0xE9; break; - case 0xFEF0: ch = 0xE9; break; - case 0xFEF1: ch = 0xEA; break; - case 0xFEF2: ch = 0xEA; break; - case 0xFEF3: ch = 0xEA; break; - case 0xFEF4: ch = 0xEA; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP708 [Serializable] diff --git a/mcs/class/I18N/Rare/CP852.cs b/mcs/class/I18N/Rare/CP852.cs index 8ab0e2601a2..794c322af1a 100644 --- a/mcs/class/I18N/Rare/CP852.cs +++ b/mcs/class/I18N/Rare/CP852.cs @@ -97,12 +97,11 @@ public class CP852 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP852 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP852 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -441,305 +440,6 @@ public class CP852 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A4: ch = 0xCF; break; - case 0x00A7: ch = 0xF5; break; - case 0x00A8: ch = 0xF9; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AD: ch = 0xF0; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B4: ch = 0xEF; break; - case 0x00B6: ch = 0x14; break; - case 0x00B8: ch = 0xF7; break; - case 0x00BB: ch = 0xAF; break; - case 0x00C1: ch = 0xB5; break; - case 0x00C2: ch = 0xB6; break; - case 0x00C4: ch = 0x8E; break; - case 0x00C7: ch = 0x80; break; - case 0x00C9: ch = 0x90; break; - case 0x00CB: ch = 0xD3; break; - case 0x00CD: ch = 0xD6; break; - case 0x00CE: ch = 0xD7; break; - case 0x00D0: ch = 0xD1; break; - case 0x00D3: ch = 0xE0; break; - case 0x00D4: ch = 0xE2; break; - case 0x00D6: ch = 0x99; break; - case 0x00D7: ch = 0x9E; break; - case 0x00DA: ch = 0xE9; break; - case 0x00DC: ch = 0x9A; break; - case 0x00DD: ch = 0xED; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E1: ch = 0xA0; break; - case 0x00E2: ch = 0x83; break; - case 0x00E4: ch = 0x84; break; - case 0x00E7: ch = 0x87; break; - case 0x00E9: ch = 0x82; break; - case 0x00EB: ch = 0x89; break; - case 0x00ED: ch = 0xA1; break; - case 0x00EE: ch = 0x8C; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F4: ch = 0x93; break; - case 0x00F6: ch = 0x94; break; - case 0x00F7: ch = 0xF6; break; - case 0x00FA: ch = 0xA3; break; - case 0x00FC: ch = 0x81; break; - case 0x00FD: ch = 0xEC; break; - case 0x0102: ch = 0xC6; break; - case 0x0103: ch = 0xC7; break; - case 0x0104: ch = 0xA4; break; - case 0x0105: ch = 0xA5; break; - case 0x0106: ch = 0x8F; break; - case 0x0107: ch = 0x86; break; - case 0x010C: ch = 0xAC; break; - case 0x010D: ch = 0x9F; break; - case 0x010E: ch = 0xD2; break; - case 0x010F: ch = 0xD4; break; - case 0x0110: ch = 0xD1; break; - case 0x0111: ch = 0xD0; break; - case 0x0118: ch = 0xA8; break; - case 0x0119: ch = 0xA9; break; - case 0x011A: ch = 0xB7; break; - case 0x011B: ch = 0xD8; break; - case 0x0139: ch = 0x91; break; - case 0x013A: ch = 0x92; break; - case 0x013D: ch = 0x95; break; - case 0x013E: ch = 0x96; break; - case 0x0141: ch = 0x9D; break; - case 0x0142: ch = 0x88; break; - case 0x0143: ch = 0xE3; break; - case 0x0144: ch = 0xE4; break; - case 0x0147: ch = 0xD5; break; - case 0x0148: ch = 0xE5; break; - case 0x0150: ch = 0x8A; break; - case 0x0151: ch = 0x8B; break; - case 0x0154: ch = 0xE8; break; - case 0x0155: ch = 0xEA; break; - case 0x0158: ch = 0xFC; break; - case 0x0159: ch = 0xFD; break; - case 0x015A: ch = 0x97; break; - case 0x015B: ch = 0x98; break; - case 0x015E: ch = 0xB8; break; - case 0x015F: ch = 0xAD; break; - case 0x0160: ch = 0xE6; break; - case 0x0161: ch = 0xE7; break; - case 0x0162: ch = 0xDD; break; - case 0x0163: ch = 0xEE; break; - case 0x0164: ch = 0x9B; break; - case 0x0165: ch = 0x9C; break; - case 0x016E: ch = 0xDE; break; - case 0x016F: ch = 0x85; break; - case 0x0170: ch = 0xEB; break; - case 0x0171: ch = 0xFB; break; - case 0x0179: ch = 0x8D; break; - case 0x017A: ch = 0xAB; break; - case 0x017B: ch = 0xBD; break; - case 0x017C: ch = 0xBE; break; - case 0x017D: ch = 0xA6; break; - case 0x017E: ch = 0xA7; break; - case 0x02C7: ch = 0xF3; break; - case 0x02D8: ch = 0xF4; break; - case 0x02D9: ch = 0xFA; break; - case 0x02DB: ch = 0xF2; break; - case 0x02DD: ch = 0xF1; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x221F: ch = 0x1C; break; - case 0x2302: ch = 0x7F; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2554: ch = 0xC9; break; - case 0x2557: ch = 0xBB; break; - case 0x255A: ch = 0xC8; break; - case 0x255D: ch = 0xBC; break; - case 0x2560: ch = 0xCC; break; - case 0x2563: ch = 0xB9; break; - case 0x2566: ch = 0xCB; break; - case 0x2569: ch = 0xCA; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266C: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP852 [Serializable] diff --git a/mcs/class/I18N/Rare/CP855.cs b/mcs/class/I18N/Rare/CP855.cs index 00556e025cd..ae071d93020 100644 --- a/mcs/class/I18N/Rare/CP855.cs +++ b/mcs/class/I18N/Rare/CP855.cs @@ -97,12 +97,11 @@ public class CP855 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP855 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP855 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -441,305 +440,6 @@ public class CP855 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A4: ch = 0xCF; break; - case 0x00A7: ch = 0xFD; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AD: ch = 0xF0; break; - case 0x00B6: ch = 0x14; break; - case 0x00BB: ch = 0xAF; break; - case 0x0401: ch = 0x85; break; - case 0x0402: ch = 0x81; break; - case 0x0403: ch = 0x83; break; - case 0x0404: ch = 0x87; break; - case 0x0405: ch = 0x89; break; - case 0x0406: ch = 0x8B; break; - case 0x0407: ch = 0x8D; break; - case 0x0408: ch = 0x8F; break; - case 0x0409: ch = 0x91; break; - case 0x040A: ch = 0x93; break; - case 0x040B: ch = 0x95; break; - case 0x040C: ch = 0x97; break; - case 0x040E: ch = 0x99; break; - case 0x040F: ch = 0x9B; break; - case 0x0410: ch = 0xA1; break; - case 0x0411: ch = 0xA3; break; - case 0x0412: ch = 0xEC; break; - case 0x0413: ch = 0xAD; break; - case 0x0414: ch = 0xA7; break; - case 0x0415: ch = 0xA9; break; - case 0x0416: ch = 0xEA; break; - case 0x0417: ch = 0xF4; break; - case 0x0418: ch = 0xB8; break; - case 0x0419: ch = 0xBE; break; - case 0x041A: ch = 0xC7; break; - case 0x041B: ch = 0xD1; break; - case 0x041C: ch = 0xD3; break; - case 0x041D: ch = 0xD5; break; - case 0x041E: ch = 0xD7; break; - case 0x041F: ch = 0xDD; break; - case 0x0420: ch = 0xE2; break; - case 0x0421: ch = 0xE4; break; - case 0x0422: ch = 0xE6; break; - case 0x0423: ch = 0xE8; break; - case 0x0424: ch = 0xAB; break; - case 0x0425: ch = 0xB6; break; - case 0x0426: ch = 0xA5; break; - case 0x0427: ch = 0xFC; break; - case 0x0428: ch = 0xF6; break; - case 0x0429: ch = 0xFA; break; - case 0x042A: ch = 0x9F; break; - case 0x042B: ch = 0xF2; break; - case 0x042C: ch = 0xEE; break; - case 0x042D: ch = 0xF8; break; - case 0x042E: ch = 0x9D; break; - case 0x042F: ch = 0xE0; break; - case 0x0430: ch = 0xA0; break; - case 0x0431: ch = 0xA2; break; - case 0x0432: ch = 0xEB; break; - case 0x0433: ch = 0xAC; break; - case 0x0434: ch = 0xA6; break; - case 0x0435: ch = 0xA8; break; - case 0x0436: ch = 0xE9; break; - case 0x0437: ch = 0xF3; break; - case 0x0438: ch = 0xB7; break; - case 0x0439: ch = 0xBD; break; - case 0x043A: ch = 0xC6; break; - case 0x043B: ch = 0xD0; break; - case 0x043C: ch = 0xD2; break; - case 0x043D: ch = 0xD4; break; - case 0x043E: ch = 0xD6; break; - case 0x043F: ch = 0xD8; break; - case 0x0440: ch = 0xE1; break; - case 0x0441: ch = 0xE3; break; - case 0x0442: ch = 0xE5; break; - case 0x0443: ch = 0xE7; break; - case 0x0444: ch = 0xAA; break; - case 0x0445: ch = 0xB5; break; - case 0x0446: ch = 0xA4; break; - case 0x0447: ch = 0xFB; break; - case 0x0448: ch = 0xF5; break; - case 0x0449: ch = 0xF9; break; - case 0x044A: ch = 0x9E; break; - case 0x044B: ch = 0xF1; break; - case 0x044C: ch = 0xED; break; - case 0x044D: ch = 0xF7; break; - case 0x044E: ch = 0x9C; break; - case 0x044F: ch = 0xDE; break; - case 0x0451: ch = 0x84; break; - case 0x0452: ch = 0x80; break; - case 0x0453: ch = 0x82; break; - case 0x0454: ch = 0x86; break; - case 0x0455: ch = 0x88; break; - case 0x0456: ch = 0x8A; break; - case 0x0457: ch = 0x8C; break; - case 0x0458: ch = 0x8E; break; - case 0x0459: ch = 0x90; break; - case 0x045A: ch = 0x92; break; - case 0x045B: ch = 0x94; break; - case 0x045C: ch = 0x96; break; - case 0x045E: ch = 0x98; break; - case 0x045F: ch = 0x9A; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x2116: ch = 0xEF; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x221F: ch = 0x1C; break; - case 0x2302: ch = 0x7F; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2554: ch = 0xC9; break; - case 0x2557: ch = 0xBB; break; - case 0x255A: ch = 0xC8; break; - case 0x255D: ch = 0xBC; break; - case 0x2560: ch = 0xCC; break; - case 0x2563: ch = 0xB9; break; - case 0x2566: ch = 0xCB; break; - case 0x2569: ch = 0xCA; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP855 [Serializable] diff --git a/mcs/class/I18N/Rare/CP857.cs b/mcs/class/I18N/Rare/CP857.cs index 0a23e11c230..1cb89945a4a 100644 --- a/mcs/class/I18N/Rare/CP857.cs +++ b/mcs/class/I18N/Rare/CP857.cs @@ -97,12 +97,11 @@ public class CP857 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP857 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP857 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -438,302 +437,6 @@ public class CP857 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - case 0x00EC: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A1: ch = 0xAD; break; - case 0x00A2: ch = 0xBD; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A4: ch = 0xCF; break; - case 0x00A5: ch = 0xBE; break; - case 0x00A6: ch = 0xDD; break; - case 0x00A7: ch = 0xF5; break; - case 0x00A8: ch = 0xF9; break; - case 0x00A9: ch = 0xB8; break; - case 0x00AA: ch = 0xD1; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0xAA; break; - case 0x00AD: ch = 0xF0; break; - case 0x00AE: ch = 0xA9; break; - case 0x00AF: ch = 0xEE; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0xFD; break; - case 0x00B3: ch = 0xFC; break; - case 0x00B4: ch = 0xEF; break; - case 0x00B5: ch = 0xE6; break; - case 0x00B6: ch = 0xF4; break; - case 0x00B7: ch = 0xFA; break; - case 0x00B8: ch = 0xF7; break; - case 0x00B9: ch = 0xFB; break; - case 0x00BA: ch = 0xD0; break; - case 0x00BB: ch = 0xAF; break; - case 0x00BC: ch = 0xAC; break; - case 0x00BD: ch = 0xAB; break; - case 0x00BE: ch = 0xF3; break; - case 0x00BF: ch = 0xA8; break; - case 0x00C0: ch = 0xB7; break; - case 0x00C1: ch = 0xB5; break; - case 0x00C2: ch = 0xB6; break; - case 0x00C3: ch = 0xC7; break; - case 0x00C4: ch = 0x8E; break; - case 0x00C5: ch = 0x8F; break; - case 0x00C6: ch = 0x92; break; - case 0x00C7: ch = 0x80; break; - case 0x00C8: ch = 0xD4; break; - case 0x00C9: ch = 0x90; break; - case 0x00CA: ch = 0xD2; break; - case 0x00CB: ch = 0xD3; break; - case 0x00CC: ch = 0xDE; break; - case 0x00CD: ch = 0xD6; break; - case 0x00CE: ch = 0xD7; break; - case 0x00CF: ch = 0xD8; break; - case 0x00D1: ch = 0xA5; break; - case 0x00D2: ch = 0xE3; break; - case 0x00D3: ch = 0xE0; break; - case 0x00D4: ch = 0xE2; break; - case 0x00D5: ch = 0xE5; break; - case 0x00D6: ch = 0x99; break; - case 0x00D7: ch = 0xE8; break; - case 0x00D8: ch = 0x9D; break; - case 0x00D9: ch = 0xEB; break; - case 0x00DA: ch = 0xE9; break; - case 0x00DB: ch = 0xEA; break; - case 0x00DC: ch = 0x9A; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E0: ch = 0x85; break; - case 0x00E1: ch = 0xA0; break; - case 0x00E2: ch = 0x83; break; - case 0x00E3: ch = 0xC6; break; - case 0x00E4: ch = 0x84; break; - case 0x00E5: ch = 0x86; break; - case 0x00E6: ch = 0x91; break; - case 0x00E7: ch = 0x87; break; - case 0x00E8: ch = 0x8A; break; - case 0x00E9: ch = 0x82; break; - case 0x00EA: ch = 0x88; break; - case 0x00EB: ch = 0x89; break; - case 0x00ED: ch = 0xA1; break; - case 0x00EE: ch = 0x8C; break; - case 0x00EF: ch = 0x8B; break; - case 0x00F1: ch = 0xA4; break; - case 0x00F2: ch = 0x95; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F4: ch = 0x93; break; - case 0x00F5: ch = 0xE4; break; - case 0x00F6: ch = 0x94; break; - case 0x00F7: ch = 0xF6; break; - case 0x00F8: ch = 0x9B; break; - case 0x00F9: ch = 0x97; break; - case 0x00FA: ch = 0xA3; break; - case 0x00FB: ch = 0x96; break; - case 0x00FC: ch = 0x81; break; - case 0x00FF: ch = 0xED; break; - case 0x011E: ch = 0xA6; break; - case 0x011F: ch = 0xA7; break; - case 0x0130: ch = 0x98; break; - case 0x0131: ch = 0x8D; break; - case 0x015E: ch = 0x9E; break; - case 0x015F: ch = 0x9F; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x203E: ch = 0xEE; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x221F: ch = 0x1C; break; - case 0x2302: ch = 0x7F; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2554: ch = 0xC9; break; - case 0x2557: ch = 0xBB; break; - case 0x255A: ch = 0xC8; break; - case 0x255D: ch = 0xBC; break; - case 0x2560: ch = 0xCC; break; - case 0x2563: ch = 0xB9; break; - case 0x2566: ch = 0xCB; break; - case 0x2569: ch = 0xCA; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP857 [Serializable] diff --git a/mcs/class/I18N/Rare/CP858.cs b/mcs/class/I18N/Rare/CP858.cs index df649e29f13..75f3d2096ec 100644 --- a/mcs/class/I18N/Rare/CP858.cs +++ b/mcs/class/I18N/Rare/CP858.cs @@ -97,12 +97,11 @@ public class CP858 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP858 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP858 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -441,305 +440,6 @@ public class CP858 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A1: ch = 0xAD; break; - case 0x00A2: ch = 0xBD; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A4: ch = 0xCF; break; - case 0x00A5: ch = 0xBE; break; - case 0x00A6: ch = 0xDD; break; - case 0x00A7: ch = 0xF5; break; - case 0x00A8: ch = 0xF9; break; - case 0x00A9: ch = 0xB8; break; - case 0x00AA: ch = 0xA6; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0xAA; break; - case 0x00AD: ch = 0xF0; break; - case 0x00AE: ch = 0xA9; break; - case 0x00AF: ch = 0xEE; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0xFD; break; - case 0x00B3: ch = 0xFC; break; - case 0x00B4: ch = 0xEF; break; - case 0x00B5: ch = 0xE6; break; - case 0x00B6: ch = 0xF4; break; - case 0x00B7: ch = 0xFA; break; - case 0x00B8: ch = 0xF7; break; - case 0x00B9: ch = 0xFB; break; - case 0x00BA: ch = 0xA7; break; - case 0x00BB: ch = 0xAF; break; - case 0x00BC: ch = 0xAC; break; - case 0x00BD: ch = 0xAB; break; - case 0x00BE: ch = 0xF3; break; - case 0x00BF: ch = 0xA8; break; - case 0x00C0: ch = 0xB7; break; - case 0x00C1: ch = 0xB5; break; - case 0x00C2: ch = 0xB6; break; - case 0x00C3: ch = 0xC7; break; - case 0x00C4: ch = 0x8E; break; - case 0x00C5: ch = 0x8F; break; - case 0x00C6: ch = 0x92; break; - case 0x00C7: ch = 0x80; break; - case 0x00C8: ch = 0xD4; break; - case 0x00C9: ch = 0x90; break; - case 0x00CA: ch = 0xD2; break; - case 0x00CB: ch = 0xD3; break; - case 0x00CC: ch = 0xDE; break; - case 0x00CD: ch = 0xD6; break; - case 0x00CE: ch = 0xD7; break; - case 0x00CF: ch = 0xD8; break; - case 0x00D0: ch = 0xD1; break; - case 0x00D1: ch = 0xA5; break; - case 0x00D2: ch = 0xE3; break; - case 0x00D3: ch = 0xE0; break; - case 0x00D4: ch = 0xE2; break; - case 0x00D5: ch = 0xE5; break; - case 0x00D6: ch = 0x99; break; - case 0x00D7: ch = 0x9E; break; - case 0x00D8: ch = 0x9D; break; - case 0x00D9: ch = 0xEB; break; - case 0x00DA: ch = 0xE9; break; - case 0x00DB: ch = 0xEA; break; - case 0x00DC: ch = 0x9A; break; - case 0x00DD: ch = 0xED; break; - case 0x00DE: ch = 0xE8; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E0: ch = 0x85; break; - case 0x00E1: ch = 0xA0; break; - case 0x00E2: ch = 0x83; break; - case 0x00E3: ch = 0xC6; break; - case 0x00E4: ch = 0x84; break; - case 0x00E5: ch = 0x86; break; - case 0x00E6: ch = 0x91; break; - case 0x00E7: ch = 0x87; break; - case 0x00E8: ch = 0x8A; break; - case 0x00E9: ch = 0x82; break; - case 0x00EA: ch = 0x88; break; - case 0x00EB: ch = 0x89; break; - case 0x00EC: ch = 0x8D; break; - case 0x00ED: ch = 0xA1; break; - case 0x00EE: ch = 0x8C; break; - case 0x00EF: ch = 0x8B; break; - case 0x00F0: ch = 0xD0; break; - case 0x00F1: ch = 0xA4; break; - case 0x00F2: ch = 0x95; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F4: ch = 0x93; break; - case 0x00F5: ch = 0xE4; break; - case 0x00F6: ch = 0x94; break; - case 0x00F7: ch = 0xF6; break; - case 0x00F8: ch = 0x9B; break; - case 0x00F9: ch = 0x97; break; - case 0x00FA: ch = 0xA3; break; - case 0x00FB: ch = 0x96; break; - case 0x00FC: ch = 0x81; break; - case 0x00FD: ch = 0xEC; break; - case 0x00FE: ch = 0xE7; break; - case 0x00FF: ch = 0x98; break; - case 0x0192: ch = 0x9F; break; - case 0x2017: ch = 0xF2; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x203E: ch = 0xEE; break; - case 0x20AC: ch = 0xD5; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x221F: ch = 0x1C; break; - case 0x2302: ch = 0x7F; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2554: ch = 0xC9; break; - case 0x2557: ch = 0xBB; break; - case 0x255A: ch = 0xC8; break; - case 0x255D: ch = 0xBC; break; - case 0x2560: ch = 0xCC; break; - case 0x2563: ch = 0xB9; break; - case 0x2566: ch = 0xCB; break; - case 0x2569: ch = 0xCA; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266C: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP858 [Serializable] diff --git a/mcs/class/I18N/Rare/CP862.cs b/mcs/class/I18N/Rare/CP862.cs index 904ee0087ad..7353ae49ef4 100644 --- a/mcs/class/I18N/Rare/CP862.cs +++ b/mcs/class/I18N/Rare/CP862.cs @@ -97,12 +97,11 @@ public class CP862 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP862 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP862 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -444,308 +443,6 @@ public class CP862 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A1: ch = 0xAD; break; - case 0x00A2: ch = 0x9B; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A5: ch = 0x9D; break; - case 0x00A7: ch = 0x15; break; - case 0x00AA: ch = 0xA6; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0xAA; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0xFD; break; - case 0x00B6: ch = 0x14; break; - case 0x00B7: ch = 0xFA; break; - case 0x00BA: ch = 0xA7; break; - case 0x00BB: ch = 0xAF; break; - case 0x00BC: ch = 0xAC; break; - case 0x00BD: ch = 0xAB; break; - case 0x00BF: ch = 0xA8; break; - case 0x00D1: ch = 0xA5; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E1: ch = 0xA0; break; - case 0x00ED: ch = 0xA1; break; - case 0x00F1: ch = 0xA4; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F7: ch = 0xF6; break; - case 0x00FA: ch = 0xA3; break; - case 0x0192: ch = 0x9F; break; - case 0x0393: ch = 0xE2; break; - case 0x0398: ch = 0xE9; break; - case 0x03A3: ch = 0xE4; break; - case 0x03A6: ch = 0xE8; break; - case 0x03A9: ch = 0xEA; break; - case 0x03B1: ch = 0xE0; break; - case 0x03B4: ch = 0xEB; break; - case 0x03B5: ch = 0xEE; break; - case 0x03BC: ch = 0xE6; break; - case 0x03C0: ch = 0xE3; break; - case 0x03C3: ch = 0xE5; break; - case 0x03C4: ch = 0xE7; break; - case 0x03C6: ch = 0xED; break; - case 0x05D0: - case 0x05D1: - case 0x05D2: - case 0x05D3: - case 0x05D4: - case 0x05D5: - case 0x05D6: - case 0x05D7: - case 0x05D8: - case 0x05D9: - case 0x05DA: - case 0x05DB: - case 0x05DC: - case 0x05DD: - case 0x05DE: - case 0x05DF: - case 0x05E0: - case 0x05E1: - case 0x05E2: - case 0x05E3: - case 0x05E4: - case 0x05E5: - case 0x05E6: - case 0x05E7: - case 0x05E8: - case 0x05E9: - case 0x05EA: - ch -= 0x0550; - break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x207F: ch = 0xFC; break; - case 0x20A7: ch = 0x9E; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x2219: ch = 0xF9; break; - case 0x221A: ch = 0xFB; break; - case 0x221E: ch = 0xEC; break; - case 0x221F: ch = 0x1C; break; - case 0x2229: ch = 0xEF; break; - case 0x2248: ch = 0xF7; break; - case 0x2261: ch = 0xF0; break; - case 0x2264: ch = 0xF3; break; - case 0x2265: ch = 0xF2; break; - case 0x2302: ch = 0x7F; break; - case 0x2310: ch = 0xA9; break; - case 0x2320: ch = 0xF4; break; - case 0x2321: ch = 0xF5; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2552: ch = 0xD5; break; - case 0x2553: ch = 0xD6; break; - case 0x2554: ch = 0xC9; break; - case 0x2555: ch = 0xB8; break; - case 0x2556: ch = 0xB7; break; - case 0x2557: ch = 0xBB; break; - case 0x2558: ch = 0xD4; break; - case 0x2559: ch = 0xD3; break; - case 0x255A: ch = 0xC8; break; - case 0x255B: ch = 0xBE; break; - case 0x255C: ch = 0xBD; break; - case 0x255D: ch = 0xBC; break; - case 0x255E: ch = 0xC6; break; - case 0x255F: ch = 0xC7; break; - case 0x2560: ch = 0xCC; break; - case 0x2561: ch = 0xB5; break; - case 0x2562: ch = 0xB6; break; - case 0x2563: ch = 0xB9; break; - case 0x2564: ch = 0xD1; break; - case 0x2565: ch = 0xD2; break; - case 0x2566: ch = 0xCB; break; - case 0x2567: ch = 0xCF; break; - case 0x2568: ch = 0xD0; break; - case 0x2569: ch = 0xCA; break; - case 0x256A: ch = 0xD8; break; - case 0x256B: ch = 0xD7; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x258C: ch = 0xDD; break; - case 0x2590: ch = 0xDE; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP862 [Serializable] diff --git a/mcs/class/I18N/Rare/CP864.cs b/mcs/class/I18N/Rare/CP864.cs index 3a9e92a2977..345fdc51e76 100644 --- a/mcs/class/I18N/Rare/CP864.cs +++ b/mcs/class/I18N/Rare/CP864.cs @@ -97,12 +97,11 @@ public class CP864 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP864 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP864 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -532,396 +531,6 @@ public class CP864 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - case 0x00A0: - case 0x00A3: - case 0x00A4: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A2: ch = 0xC0; break; - case 0x00A6: ch = 0xDB; break; - case 0x00A7: ch = 0x15; break; - case 0x00AB: ch = 0x97; break; - case 0x00AC: ch = 0xDC; break; - case 0x00AD: ch = 0xA1; break; - case 0x00B0: ch = 0x80; break; - case 0x00B1: ch = 0x93; break; - case 0x00B6: ch = 0x14; break; - case 0x00B7: ch = 0x81; break; - case 0x00BB: ch = 0x98; break; - case 0x00BC: ch = 0x95; break; - case 0x00BD: ch = 0x94; break; - case 0x00D7: ch = 0xDE; break; - case 0x00F7: ch = 0xDD; break; - case 0x03B2: ch = 0x90; break; - case 0x03C6: ch = 0x92; break; - case 0x060C: ch = 0xAC; break; - case 0x061B: ch = 0xBB; break; - case 0x061F: ch = 0xBF; break; - case 0x0621: - case 0x0622: - case 0x0623: - case 0x0624: - ch -= 0x0560; - break; - case 0x0626: - case 0x0627: - case 0x0628: - case 0x0629: - case 0x062A: - case 0x062B: - case 0x062C: - case 0x062D: - case 0x062E: - case 0x062F: - case 0x0630: - case 0x0631: - case 0x0632: - case 0x0633: - case 0x0634: - case 0x0635: - case 0x0636: - case 0x0637: - case 0x0638: - case 0x0639: - case 0x063A: - ch -= 0x0560; - break; - case 0x0640: - case 0x0641: - case 0x0642: - case 0x0643: - case 0x0644: - case 0x0645: - case 0x0646: - case 0x0647: - case 0x0648: - case 0x0649: - ch -= 0x0560; - break; - case 0x064A: ch = 0xFD; break; - case 0x0651: ch = 0xF1; break; - case 0x0660: - case 0x0661: - case 0x0662: - case 0x0663: - case 0x0664: - case 0x0665: - case 0x0666: - case 0x0667: - case 0x0668: - case 0x0669: - ch -= 0x05B0; - break; - case 0x066A: ch = 0x25; break; - case 0x066B: ch = 0x2C; break; - case 0x066C: ch = 0x2E; break; - case 0x066D: ch = 0x2A; break; - case 0x200B: ch = 0x9F; break; - case 0x203C: ch = 0x13; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x2219: ch = 0x82; break; - case 0x221A: ch = 0x83; break; - case 0x221E: ch = 0x91; break; - case 0x221F: ch = 0x1C; break; - case 0x2248: ch = 0x96; break; - case 0x2302: ch = 0x7F; break; - case 0x2500: ch = 0x85; break; - case 0x2502: ch = 0x86; break; - case 0x250C: ch = 0x8D; break; - case 0x2510: ch = 0x8C; break; - case 0x2514: ch = 0x8E; break; - case 0x2518: ch = 0x8F; break; - case 0x251C: ch = 0x8A; break; - case 0x2524: ch = 0x88; break; - case 0x252C: ch = 0x89; break; - case 0x2534: ch = 0x8B; break; - case 0x253C: ch = 0x87; break; - case 0x2550: ch = 0x05; break; - case 0x2551: ch = 0x06; break; - case 0x2554: ch = 0x0D; break; - case 0x2557: ch = 0x0C; break; - case 0x255A: ch = 0x0E; break; - case 0x255D: ch = 0x0F; break; - case 0x2560: ch = 0x0A; break; - case 0x2563: ch = 0x08; break; - case 0x2566: ch = 0x09; break; - case 0x2569: ch = 0x0B; break; - case 0x256C: ch = 0x07; break; - case 0x2592: ch = 0x84; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x263A: ch = 0x01; break; - case 0x263C: ch = 0x04; break; - case 0x266A: ch = 0x02; break; - case 0x266C: ch = 0x03; break; - case 0xFE7C: ch = 0xF1; break; - case 0xFE7D: ch = 0xF0; break; - case 0xFE80: ch = 0xC1; break; - case 0xFE81: ch = 0xC2; break; - case 0xFE82: ch = 0xA2; break; - case 0xFE83: ch = 0xC3; break; - case 0xFE84: ch = 0xA5; break; - case 0xFE85: ch = 0xC4; break; - case 0xFE86: ch = 0xC4; break; - case 0xFE8B: ch = 0xC6; break; - case 0xFE8C: ch = 0xC6; break; - case 0xFE8D: ch = 0xC7; break; - case 0xFE8E: ch = 0xA8; break; - case 0xFE8F: ch = 0xA9; break; - case 0xFE90: ch = 0xA9; break; - case 0xFE91: ch = 0xC8; break; - case 0xFE92: ch = 0xC8; break; - case 0xFE93: ch = 0xC9; break; - case 0xFE94: ch = 0xC9; break; - case 0xFE95: ch = 0xAA; break; - case 0xFE96: ch = 0xAA; break; - case 0xFE97: ch = 0xCA; break; - case 0xFE98: ch = 0xCA; break; - case 0xFE99: ch = 0xAB; break; - case 0xFE9A: ch = 0xAB; break; - case 0xFE9B: ch = 0xCB; break; - case 0xFE9C: ch = 0xCB; break; - case 0xFE9D: ch = 0xAD; break; - case 0xFE9E: ch = 0xAD; break; - case 0xFE9F: ch = 0xCC; break; - case 0xFEA0: ch = 0xCC; break; - case 0xFEA1: ch = 0xAE; break; - case 0xFEA2: ch = 0xAE; break; - case 0xFEA3: ch = 0xCD; break; - case 0xFEA4: ch = 0xCD; break; - case 0xFEA5: ch = 0xAF; break; - case 0xFEA6: ch = 0xAF; break; - case 0xFEA7: ch = 0xCE; break; - case 0xFEA8: ch = 0xCE; break; - case 0xFEA9: ch = 0xCF; break; - case 0xFEAA: ch = 0xCF; break; - case 0xFEAB: ch = 0xD0; break; - case 0xFEAC: ch = 0xD0; break; - case 0xFEAD: ch = 0xD1; break; - case 0xFEAE: ch = 0xD1; break; - case 0xFEAF: ch = 0xD2; break; - case 0xFEB0: ch = 0xD2; break; - case 0xFEB1: ch = 0xBC; break; - case 0xFEB2: ch = 0xBC; break; - case 0xFEB3: ch = 0xD3; break; - case 0xFEB4: ch = 0xD3; break; - case 0xFEB5: ch = 0xBD; break; - case 0xFEB6: ch = 0xBD; break; - case 0xFEB7: ch = 0xD4; break; - case 0xFEB8: ch = 0xD4; break; - case 0xFEB9: ch = 0xBE; break; - case 0xFEBA: ch = 0xBE; break; - case 0xFEBB: ch = 0xD5; break; - case 0xFEBC: ch = 0xD5; break; - case 0xFEBD: ch = 0xEB; break; - case 0xFEBE: ch = 0xEB; break; - case 0xFEBF: ch = 0xD6; break; - case 0xFEC0: ch = 0xD6; break; - case 0xFEC1: ch = 0xD7; break; - case 0xFEC2: ch = 0xD7; break; - case 0xFEC3: ch = 0xD7; break; - case 0xFEC4: ch = 0xD7; break; - case 0xFEC5: ch = 0xD8; break; - case 0xFEC6: ch = 0xD8; break; - case 0xFEC7: ch = 0xD8; break; - case 0xFEC8: ch = 0xD8; break; - case 0xFEC9: ch = 0xDF; break; - case 0xFECA: ch = 0xC5; break; - case 0xFECB: ch = 0xD9; break; - case 0xFECC: ch = 0xEC; break; - case 0xFECD: ch = 0xEE; break; - case 0xFECE: ch = 0xED; break; - case 0xFECF: ch = 0xDA; break; - case 0xFED0: ch = 0xF7; break; - case 0xFED1: ch = 0xBA; break; - case 0xFED2: ch = 0xBA; break; - case 0xFED3: ch = 0xE1; break; - case 0xFED4: ch = 0xE1; break; - case 0xFED5: ch = 0xF8; break; - case 0xFED6: ch = 0xF8; break; - case 0xFED7: ch = 0xE2; break; - case 0xFED8: ch = 0xE2; break; - case 0xFED9: ch = 0xFC; break; - case 0xFEDA: ch = 0xFC; break; - case 0xFEDB: ch = 0xE3; break; - case 0xFEDC: ch = 0xE3; break; - case 0xFEDD: ch = 0xFB; break; - case 0xFEDE: ch = 0xFB; break; - case 0xFEDF: ch = 0xE4; break; - case 0xFEE0: ch = 0xE4; break; - case 0xFEE1: ch = 0xEF; break; - case 0xFEE2: ch = 0xEF; break; - case 0xFEE3: ch = 0xE5; break; - case 0xFEE4: ch = 0xE5; break; - case 0xFEE5: ch = 0xF2; break; - case 0xFEE6: ch = 0xF2; break; - case 0xFEE7: ch = 0xE6; break; - case 0xFEE8: ch = 0xE6; break; - case 0xFEE9: ch = 0xF3; break; - case 0xFEEA: ch = 0xF3; break; - case 0xFEEB: ch = 0xE7; break; - case 0xFEEC: ch = 0xF4; break; - case 0xFEED: ch = 0xE8; break; - case 0xFEEE: ch = 0xE8; break; - case 0xFEEF: ch = 0xE9; break; - case 0xFEF0: ch = 0xF5; break; - case 0xFEF1: ch = 0xFD; break; - case 0xFEF2: ch = 0xF6; break; - case 0xFEF3: ch = 0xEA; break; - case 0xFEF4: ch = 0xEA; break; - case 0xFEF5: ch = 0xF9; break; - case 0xFEF6: ch = 0xFA; break; - case 0xFEF7: ch = 0x99; break; - case 0xFEF8: ch = 0x9A; break; - case 0xFEFB: ch = 0x9D; break; - case 0xFEFC: ch = 0x9E; break; - case 0xFFE8: ch = 0x86; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP864 [Serializable] diff --git a/mcs/class/I18N/Rare/CP866.cs b/mcs/class/I18N/Rare/CP866.cs index 0a331775056..c96363a4491 100644 --- a/mcs/class/I18N/Rare/CP866.cs +++ b/mcs/class/I18N/Rare/CP866.cs @@ -97,12 +97,11 @@ public class CP866 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP866 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP866 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -446,310 +445,6 @@ public class CP866 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A4: ch = 0xFD; break; - case 0x00A7: ch = 0x15; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B6: ch = 0x14; break; - case 0x00B7: ch = 0xFA; break; - case 0x0401: ch = 0xF0; break; - case 0x0404: ch = 0xF2; break; - case 0x0407: ch = 0xF4; break; - case 0x040E: ch = 0xF6; break; - case 0x0410: - case 0x0411: - case 0x0412: - case 0x0413: - case 0x0414: - case 0x0415: - case 0x0416: - case 0x0417: - case 0x0418: - case 0x0419: - case 0x041A: - case 0x041B: - case 0x041C: - case 0x041D: - case 0x041E: - case 0x041F: - case 0x0420: - case 0x0421: - case 0x0422: - case 0x0423: - case 0x0424: - case 0x0425: - case 0x0426: - case 0x0427: - case 0x0428: - case 0x0429: - case 0x042A: - case 0x042B: - case 0x042C: - case 0x042D: - case 0x042E: - case 0x042F: - case 0x0430: - case 0x0431: - case 0x0432: - case 0x0433: - case 0x0434: - case 0x0435: - case 0x0436: - case 0x0437: - case 0x0438: - case 0x0439: - case 0x043A: - case 0x043B: - case 0x043C: - case 0x043D: - case 0x043E: - case 0x043F: - ch -= 0x0390; - break; - case 0x0440: - case 0x0441: - case 0x0442: - case 0x0443: - case 0x0444: - case 0x0445: - case 0x0446: - case 0x0447: - case 0x0448: - case 0x0449: - case 0x044A: - case 0x044B: - case 0x044C: - case 0x044D: - case 0x044E: - case 0x044F: - ch -= 0x0360; - break; - case 0x0451: ch = 0xF1; break; - case 0x0454: ch = 0xF3; break; - case 0x0457: ch = 0xF5; break; - case 0x045E: ch = 0xF7; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x2116: ch = 0xFC; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x2219: ch = 0xF9; break; - case 0x221A: ch = 0xFB; break; - case 0x221F: ch = 0x1C; break; - case 0x2302: ch = 0x7F; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2552: ch = 0xD5; break; - case 0x2553: ch = 0xD6; break; - case 0x2554: ch = 0xC9; break; - case 0x2555: ch = 0xB8; break; - case 0x2556: ch = 0xB7; break; - case 0x2557: ch = 0xBB; break; - case 0x2558: ch = 0xD4; break; - case 0x2559: ch = 0xD3; break; - case 0x255A: ch = 0xC8; break; - case 0x255B: ch = 0xBE; break; - case 0x255C: ch = 0xBD; break; - case 0x255D: ch = 0xBC; break; - case 0x255E: ch = 0xC6; break; - case 0x255F: ch = 0xC7; break; - case 0x2560: ch = 0xCC; break; - case 0x2561: ch = 0xB5; break; - case 0x2562: ch = 0xB6; break; - case 0x2563: ch = 0xB9; break; - case 0x2564: ch = 0xD1; break; - case 0x2565: ch = 0xD2; break; - case 0x2566: ch = 0xCB; break; - case 0x2567: ch = 0xCF; break; - case 0x2568: ch = 0xD0; break; - case 0x2569: ch = 0xCA; break; - case 0x256A: ch = 0xD8; break; - case 0x256B: ch = 0xD7; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x258C: ch = 0xDD; break; - case 0x2590: ch = 0xDE; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP866 [Serializable] diff --git a/mcs/class/I18N/Rare/CP869.cs b/mcs/class/I18N/Rare/CP869.cs index 752be5ede0b..9b60c0aa766 100644 --- a/mcs/class/I18N/Rare/CP869.cs +++ b/mcs/class/I18N/Rare/CP869.cs @@ -97,12 +97,11 @@ public class CP869 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP869 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP869 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -442,306 +441,6 @@ public class CP869 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A6: ch = 0x8A; break; - case 0x00A7: ch = 0xF5; break; - case 0x00A8: ch = 0xF9; break; - case 0x00A9: ch = 0x97; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0x89; break; - case 0x00AD: ch = 0xF0; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0x99; break; - case 0x00B3: ch = 0x9A; break; - case 0x00B4: ch = 0xEF; break; - case 0x00B6: ch = 0x14; break; - case 0x00B7: ch = 0x88; break; - case 0x00BB: ch = 0xAF; break; - case 0x00BD: ch = 0xAB; break; - case 0x0385: ch = 0xF7; break; - case 0x0386: ch = 0x86; break; - case 0x0387: ch = 0x88; break; - case 0x0388: ch = 0x8D; break; - case 0x0389: ch = 0x8F; break; - case 0x038A: ch = 0x90; break; - case 0x038C: ch = 0x92; break; - case 0x038E: ch = 0x95; break; - case 0x038F: ch = 0x98; break; - case 0x0390: ch = 0xA1; break; - case 0x0391: - case 0x0392: - case 0x0393: - case 0x0394: - case 0x0395: - case 0x0396: - case 0x0397: - ch -= 0x02ED; - break; - case 0x0398: ch = 0xAC; break; - case 0x0399: ch = 0xAD; break; - case 0x039A: - case 0x039B: - case 0x039C: - case 0x039D: - ch -= 0x02E5; - break; - case 0x039E: ch = 0xBD; break; - case 0x039F: ch = 0xBE; break; - case 0x03A0: ch = 0xC6; break; - case 0x03A1: ch = 0xC7; break; - case 0x03A3: - case 0x03A4: - case 0x03A5: - case 0x03A6: - case 0x03A7: - case 0x03A8: - case 0x03A9: - ch -= 0x02D4; - break; - case 0x03AA: ch = 0x91; break; - case 0x03AB: ch = 0x96; break; - case 0x03AC: ch = 0x9B; break; - case 0x03AD: ch = 0x9D; break; - case 0x03AE: ch = 0x9E; break; - case 0x03AF: ch = 0x9F; break; - case 0x03B0: ch = 0xFC; break; - case 0x03B1: ch = 0xD6; break; - case 0x03B2: ch = 0xD7; break; - case 0x03B3: ch = 0xD8; break; - case 0x03B4: ch = 0xDD; break; - case 0x03B5: ch = 0xDE; break; - case 0x03B6: - case 0x03B7: - case 0x03B8: - case 0x03B9: - case 0x03BA: - case 0x03BB: - case 0x03BC: - case 0x03BD: - case 0x03BE: - case 0x03BF: - case 0x03C0: - case 0x03C1: - ch -= 0x02D6; - break; - case 0x03C2: ch = 0xED; break; - case 0x03C3: ch = 0xEC; break; - case 0x03C4: ch = 0xEE; break; - case 0x03C5: ch = 0xF2; break; - case 0x03C6: ch = 0xF3; break; - case 0x03C7: ch = 0xF4; break; - case 0x03C8: ch = 0xF6; break; - case 0x03C9: ch = 0xFA; break; - case 0x03CA: ch = 0xA0; break; - case 0x03CB: ch = 0xFB; break; - case 0x03CC: ch = 0xA2; break; - case 0x03CD: ch = 0xA3; break; - case 0x03CE: ch = 0xFD; break; - case 0x03D5: ch = 0xF3; break; - case 0x2015: ch = 0x8E; break; - case 0x2018: ch = 0x8B; break; - case 0x2019: ch = 0x8C; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x221F: ch = 0x1C; break; - case 0x2302: ch = 0x7F; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2554: ch = 0xC9; break; - case 0x2557: ch = 0xBB; break; - case 0x255A: ch = 0xC8; break; - case 0x255D: ch = 0xBC; break; - case 0x2560: ch = 0xCC; break; - case 0x2563: ch = 0xB9; break; - case 0x2566: ch = 0xCB; break; - case 0x2569: ch = 0xCA; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP869 [Serializable] diff --git a/mcs/class/I18N/Rare/CP870.cs b/mcs/class/I18N/Rare/CP870.cs index 9570ccccebb..44aab924edf 100644 --- a/mcs/class/I18N/Rare/CP870.cs +++ b/mcs/class/I18N/Rare/CP870.cs @@ -97,12 +97,11 @@ public class CP870 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP870 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP870 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -546,409 +545,6 @@ public class CP870 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x4A; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0x5A; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x6A; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA1; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x41; break; - case 0x00A4: ch = 0x9F; break; - case 0x00A7: ch = 0xB5; break; - case 0x00A8: ch = 0xBD; break; - case 0x00AD: ch = 0xCA; break; - case 0x00B0: ch = 0x90; break; - case 0x00B4: ch = 0xBE; break; - case 0x00B8: ch = 0x9D; break; - case 0x00C1: ch = 0x65; break; - case 0x00C2: ch = 0x62; break; - case 0x00C4: ch = 0x63; break; - case 0x00C7: ch = 0x68; break; - case 0x00C9: ch = 0x71; break; - case 0x00CB: ch = 0x73; break; - case 0x00CD: ch = 0x75; break; - case 0x00CE: ch = 0x76; break; - case 0x00D0: ch = 0xAC; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEB; break; - case 0x00D6: ch = 0xEC; break; - case 0x00D7: ch = 0xBF; break; - case 0x00DA: ch = 0xFE; break; - case 0x00DC: ch = 0xFC; break; - case 0x00DD: ch = 0xAD; break; - case 0x00DF: ch = 0x59; break; - case 0x00E1: ch = 0x45; break; - case 0x00E2: ch = 0x42; break; - case 0x00E4: ch = 0x43; break; - case 0x00E7: ch = 0x48; break; - case 0x00E9: ch = 0x51; break; - case 0x00EB: ch = 0x53; break; - case 0x00ED: ch = 0x55; break; - case 0x00EE: ch = 0x56; break; - case 0x00F3: ch = 0xCE; break; - case 0x00F4: ch = 0xCB; break; - case 0x00F6: ch = 0xCC; break; - case 0x00F7: ch = 0xE1; break; - case 0x00FA: ch = 0xDE; break; - case 0x00FC: ch = 0xDC; break; - case 0x00FD: ch = 0x8D; break; - case 0x0102: ch = 0x66; break; - case 0x0103: ch = 0x46; break; - case 0x0104: ch = 0xB1; break; - case 0x0105: ch = 0xA0; break; - case 0x0106: ch = 0x69; break; - case 0x0107: ch = 0x49; break; - case 0x010C: ch = 0x67; break; - case 0x010D: ch = 0x47; break; - case 0x010E: ch = 0xFA; break; - case 0x010F: ch = 0xEA; break; - case 0x0110: ch = 0xAC; break; - case 0x0111: ch = 0x8C; break; - case 0x0118: ch = 0x72; break; - case 0x0119: ch = 0x52; break; - case 0x011A: ch = 0xDA; break; - case 0x011B: ch = 0xDF; break; - case 0x0139: ch = 0x78; break; - case 0x013A: ch = 0x58; break; - case 0x013D: ch = 0x77; break; - case 0x013E: ch = 0x57; break; - case 0x0141: ch = 0xBA; break; - case 0x0142: ch = 0x9A; break; - case 0x0143: ch = 0xBB; break; - case 0x0144: ch = 0x9B; break; - case 0x0147: ch = 0xAB; break; - case 0x0148: ch = 0x8B; break; - case 0x0150: ch = 0xEF; break; - case 0x0151: ch = 0xCF; break; - case 0x0154: ch = 0xED; break; - case 0x0155: ch = 0xCD; break; - case 0x0158: ch = 0xAE; break; - case 0x0159: ch = 0x8E; break; - case 0x015A: ch = 0xAA; break; - case 0x015B: ch = 0x8A; break; - case 0x015E: ch = 0xAF; break; - case 0x015F: ch = 0x8F; break; - case 0x0160: ch = 0xBC; break; - case 0x0161: ch = 0x9C; break; - case 0x0162: ch = 0xB3; break; - case 0x0163: ch = 0x44; break; - case 0x0164: ch = 0xFD; break; - case 0x0165: ch = 0xDD; break; - case 0x016E: ch = 0x74; break; - case 0x016F: ch = 0x54; break; - case 0x0170: ch = 0xFB; break; - case 0x0171: ch = 0xDB; break; - case 0x0179: ch = 0xB9; break; - case 0x017A: ch = 0xB7; break; - case 0x017B: ch = 0xB4; break; - case 0x017C: ch = 0xB2; break; - case 0x017D: ch = 0xB8; break; - case 0x017E: ch = 0xB6; break; - case 0x02C7: ch = 0x70; break; - case 0x02D8: ch = 0x80; break; - case 0x02D9: ch = 0xB0; break; - case 0x02DB: ch = 0x9E; break; - case 0x02DD: ch = 0x64; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x4A; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0x5A; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x6A; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA1; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP870 [Serializable] diff --git a/mcs/class/I18N/Rare/CP875.cs b/mcs/class/I18N/Rare/CP875.cs index 11e1992717f..e92b12485a3 100644 --- a/mcs/class/I18N/Rare/CP875.cs +++ b/mcs/class/I18N/Rare/CP875.cs @@ -97,12 +97,11 @@ public class CP875 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP875 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP875 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -555,418 +554,6 @@ public class CP875 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 4) switch(ch) - { - case 0x000B: - case 0x000C: - case 0x000D: - case 0x000E: - case 0x000F: - case 0x0010: - case 0x0011: - case 0x0012: - case 0x0013: - case 0x0018: - case 0x0019: - case 0x001C: - case 0x001D: - case 0x001E: - case 0x001F: - break; - case 0x0004: ch = 0x37; break; - case 0x0005: ch = 0x2D; break; - case 0x0006: ch = 0x2E; break; - case 0x0007: ch = 0x2F; break; - case 0x0008: ch = 0x16; break; - case 0x0009: ch = 0x05; break; - case 0x000A: ch = 0x25; break; - case 0x0014: ch = 0x3C; break; - case 0x0015: ch = 0x3D; break; - case 0x0016: ch = 0x32; break; - case 0x0017: ch = 0x26; break; - case 0x001A: ch = 0x3F; break; - case 0x001B: ch = 0x27; break; - case 0x0020: ch = 0x40; break; - case 0x0021: ch = 0x4F; break; - case 0x0022: ch = 0x7F; break; - case 0x0023: ch = 0x7B; break; - case 0x0024: ch = 0x5B; break; - case 0x0025: ch = 0x6C; break; - case 0x0026: ch = 0x50; break; - case 0x0027: ch = 0x7D; break; - case 0x0028: ch = 0x4D; break; - case 0x0029: ch = 0x5D; break; - case 0x002A: ch = 0x5C; break; - case 0x002B: ch = 0x4E; break; - case 0x002C: ch = 0x6B; break; - case 0x002D: ch = 0x60; break; - case 0x002E: ch = 0x4B; break; - case 0x002F: ch = 0x61; break; - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - ch += 0x00C0; - break; - case 0x003A: ch = 0x7A; break; - case 0x003B: ch = 0x5E; break; - case 0x003C: ch = 0x4C; break; - case 0x003D: ch = 0x7E; break; - case 0x003E: ch = 0x6E; break; - case 0x003F: ch = 0x6F; break; - case 0x0040: ch = 0x7C; break; - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - ch += 0x0080; - break; - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - ch += 0x0087; - break; - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - ch += 0x008F; - break; - case 0x005B: ch = 0x4A; break; - case 0x005C: ch = 0xE0; break; - case 0x005D: ch = 0x5A; break; - case 0x005E: ch = 0x5F; break; - case 0x005F: ch = 0x6D; break; - case 0x0060: ch = 0x79; break; - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - ch += 0x0020; - break; - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - ch += 0x0027; - break; - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - ch += 0x002F; - break; - case 0x007B: ch = 0xC0; break; - case 0x007C: ch = 0x6A; break; - case 0x007D: ch = 0xD0; break; - case 0x007E: ch = 0xA1; break; - case 0x007F: ch = 0x07; break; - case 0x0080: - case 0x0081: - case 0x0082: - case 0x0083: - case 0x0084: - ch -= 0x0060; - break; - case 0x0085: ch = 0x15; break; - case 0x0086: ch = 0x06; break; - case 0x0087: ch = 0x17; break; - case 0x0088: - case 0x0089: - case 0x008A: - case 0x008B: - case 0x008C: - ch -= 0x0060; - break; - case 0x008D: ch = 0x09; break; - case 0x008E: ch = 0x0A; break; - case 0x008F: ch = 0x1B; break; - case 0x0090: ch = 0x30; break; - case 0x0091: ch = 0x31; break; - case 0x0092: ch = 0x1A; break; - case 0x0093: - case 0x0094: - case 0x0095: - case 0x0096: - ch -= 0x0060; - break; - case 0x0097: ch = 0x08; break; - case 0x0098: - case 0x0099: - case 0x009A: - case 0x009B: - ch -= 0x0060; - break; - case 0x009C: ch = 0x04; break; - case 0x009D: ch = 0x14; break; - case 0x009E: ch = 0x3E; break; - case 0x009F: ch = 0xFF; break; - case 0x00A0: ch = 0x74; break; - case 0x00A3: ch = 0xB0; break; - case 0x00A6: ch = 0xDF; break; - case 0x00A7: ch = 0xEB; break; - case 0x00A8: ch = 0x70; break; - case 0x00A9: ch = 0xFB; break; - case 0x00AB: ch = 0xEE; break; - case 0x00AC: ch = 0xEF; break; - case 0x00AD: ch = 0xCA; break; - case 0x00B0: ch = 0x90; break; - case 0x00B1: ch = 0xDA; break; - case 0x00B2: ch = 0xEA; break; - case 0x00B3: ch = 0xFA; break; - case 0x00B4: ch = 0xA0; break; - case 0x00B7: ch = 0xDD; break; - case 0x00BB: ch = 0xFE; break; - case 0x00BD: ch = 0xDB; break; - case 0x0385: ch = 0x80; break; - case 0x0386: ch = 0x71; break; - case 0x0387: ch = 0xDD; break; - case 0x0388: ch = 0x72; break; - case 0x0389: ch = 0x73; break; - case 0x038A: ch = 0x75; break; - case 0x038C: ch = 0x76; break; - case 0x038E: ch = 0x77; break; - case 0x038F: ch = 0x78; break; - case 0x0390: ch = 0xCC; break; - case 0x0391: - case 0x0392: - case 0x0393: - case 0x0394: - case 0x0395: - case 0x0396: - case 0x0397: - case 0x0398: - case 0x0399: - ch -= 0x0350; - break; - case 0x039A: - case 0x039B: - case 0x039C: - case 0x039D: - case 0x039E: - case 0x039F: - case 0x03A0: - case 0x03A1: - ch -= 0x0349; - break; - case 0x03A3: ch = 0x59; break; - case 0x03A4: - case 0x03A5: - case 0x03A6: - case 0x03A7: - case 0x03A8: - case 0x03A9: - case 0x03AA: - case 0x03AB: - ch -= 0x0342; - break; - case 0x03AC: ch = 0xB1; break; - case 0x03AD: ch = 0xB2; break; - case 0x03AE: ch = 0xB3; break; - case 0x03AF: ch = 0xB5; break; - case 0x03B0: ch = 0xCD; break; - case 0x03B1: - case 0x03B2: - case 0x03B3: - case 0x03B4: - case 0x03B5: - case 0x03B6: - ch -= 0x0327; - break; - case 0x03B7: - case 0x03B8: - case 0x03B9: - case 0x03BA: - case 0x03BB: - case 0x03BC: - ch -= 0x031D; - break; - case 0x03BD: - case 0x03BE: - case 0x03BF: - case 0x03C0: - case 0x03C1: - ch -= 0x0313; - break; - case 0x03C2: ch = 0xBA; break; - case 0x03C3: ch = 0xAF; break; - case 0x03C4: - case 0x03C5: - case 0x03C6: - case 0x03C7: - case 0x03C8: - ch -= 0x0309; - break; - case 0x03C9: ch = 0xCB; break; - case 0x03CA: ch = 0xB4; break; - case 0x03CB: ch = 0xB8; break; - case 0x03CC: ch = 0xB6; break; - case 0x03CD: ch = 0xB7; break; - case 0x03CE: ch = 0xB9; break; - case 0x03D5: ch = 0xBD; break; - case 0x2015: ch = 0xCF; break; - case 0x2018: ch = 0xCE; break; - case 0x2019: ch = 0xDE; break; - case 0xFF01: ch = 0x4F; break; - case 0xFF02: ch = 0x7F; break; - case 0xFF03: ch = 0x7B; break; - case 0xFF04: ch = 0x5B; break; - case 0xFF05: ch = 0x6C; break; - case 0xFF06: ch = 0x50; break; - case 0xFF07: ch = 0x7D; break; - case 0xFF08: ch = 0x4D; break; - case 0xFF09: ch = 0x5D; break; - case 0xFF0A: ch = 0x5C; break; - case 0xFF0B: ch = 0x4E; break; - case 0xFF0C: ch = 0x6B; break; - case 0xFF0D: ch = 0x60; break; - case 0xFF0E: ch = 0x4B; break; - case 0xFF0F: ch = 0x61; break; - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - ch -= 0xFE20; - break; - case 0xFF1A: ch = 0x7A; break; - case 0xFF1B: ch = 0x5E; break; - case 0xFF1C: ch = 0x4C; break; - case 0xFF1D: ch = 0x7E; break; - case 0xFF1E: ch = 0x6E; break; - case 0xFF1F: ch = 0x6F; break; - case 0xFF20: ch = 0x7C; break; - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - ch -= 0xFE60; - break; - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - ch -= 0xFE59; - break; - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - ch -= 0xFE51; - break; - case 0xFF3B: ch = 0x4A; break; - case 0xFF3C: ch = 0xE0; break; - case 0xFF3D: ch = 0x5A; break; - case 0xFF3E: ch = 0x5F; break; - case 0xFF3F: ch = 0x6D; break; - case 0xFF40: ch = 0x79; break; - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - ch -= 0xFEC0; - break; - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - ch -= 0xFEB9; - break; - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - ch -= 0xFEB1; - break; - case 0xFF5B: ch = 0xC0; break; - case 0xFF5C: ch = 0x6A; break; - case 0xFF5D: ch = 0xD0; break; - case 0xFF5E: ch = 0xA1; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP875 [Serializable] diff --git a/mcs/class/I18N/West/CP10000.cs b/mcs/class/I18N/West/CP10000.cs index f913f0d33d4..6b575c96e3d 100644 --- a/mcs/class/I18N/West/CP10000.cs +++ b/mcs/class/I18N/West/CP10000.cs @@ -97,12 +97,11 @@ public class CP10000 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP10000 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP10000 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -304,168 +303,6 @@ public class CP10000 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x00A2: - case 0x00A3: - case 0x00A9: - case 0x00B1: - case 0x00B5: - break; - case 0x00A0: ch = 0xCA; break; - case 0x00A1: ch = 0xC1; break; - case 0x00A4: ch = 0xDB; break; - case 0x00A5: ch = 0xB4; break; - case 0x00A7: ch = 0xA4; break; - case 0x00A8: ch = 0xAC; break; - case 0x00AA: ch = 0xBB; break; - case 0x00AB: ch = 0xC7; break; - case 0x00AC: ch = 0xC2; break; - case 0x00AE: ch = 0xA8; break; - case 0x00AF: ch = 0xF8; break; - case 0x00B0: ch = 0xA1; break; - case 0x00B4: ch = 0xAB; break; - case 0x00B6: ch = 0xA6; break; - case 0x00B7: ch = 0xE1; break; - case 0x00B8: ch = 0xFC; break; - case 0x00BA: ch = 0xBC; break; - case 0x00BB: ch = 0xC8; break; - case 0x00BF: ch = 0xC0; break; - case 0x00C0: ch = 0xCB; break; - case 0x00C1: ch = 0xE7; break; - case 0x00C2: ch = 0xE5; break; - case 0x00C3: ch = 0xCC; break; - case 0x00C4: ch = 0x80; break; - case 0x00C5: ch = 0x81; break; - case 0x00C6: ch = 0xAE; break; - case 0x00C7: ch = 0x82; break; - case 0x00C8: ch = 0xE9; break; - case 0x00C9: ch = 0x83; break; - case 0x00CA: ch = 0xE6; break; - case 0x00CB: ch = 0xE8; break; - case 0x00CC: ch = 0xED; break; - case 0x00CD: ch = 0xEA; break; - case 0x00CE: ch = 0xEB; break; - case 0x00CF: ch = 0xEC; break; - case 0x00D1: ch = 0x84; break; - case 0x00D2: ch = 0xF1; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEF; break; - case 0x00D5: ch = 0xCD; break; - case 0x00D6: ch = 0x85; break; - case 0x00D8: ch = 0xAF; break; - case 0x00D9: ch = 0xF4; break; - case 0x00DA: ch = 0xF2; break; - case 0x00DB: ch = 0xF3; break; - case 0x00DC: ch = 0x86; break; - case 0x00DF: ch = 0xA7; break; - case 0x00E0: ch = 0x88; break; - case 0x00E1: ch = 0x87; break; - case 0x00E2: ch = 0x89; break; - case 0x00E3: ch = 0x8B; break; - case 0x00E4: ch = 0x8A; break; - case 0x00E5: ch = 0x8C; break; - case 0x00E6: ch = 0xBE; break; - case 0x00E7: ch = 0x8D; break; - case 0x00E8: ch = 0x8F; break; - case 0x00E9: ch = 0x8E; break; - case 0x00EA: ch = 0x90; break; - case 0x00EB: ch = 0x91; break; - case 0x00EC: ch = 0x93; break; - case 0x00ED: ch = 0x92; break; - case 0x00EE: ch = 0x94; break; - case 0x00EF: ch = 0x95; break; - case 0x00F1: ch = 0x96; break; - case 0x00F2: ch = 0x98; break; - case 0x00F3: ch = 0x97; break; - case 0x00F4: ch = 0x99; break; - case 0x00F5: ch = 0x9B; break; - case 0x00F6: ch = 0x9A; break; - case 0x00F7: ch = 0xD6; break; - case 0x00F8: ch = 0xBF; break; - case 0x00F9: ch = 0x9D; break; - case 0x00FA: ch = 0x9C; break; - case 0x00FB: ch = 0x9E; break; - case 0x00FC: ch = 0x9F; break; - case 0x00FF: ch = 0xD8; break; - case 0x0131: ch = 0xF5; break; - case 0x0152: ch = 0xCE; break; - case 0x0153: ch = 0xCF; break; - case 0x0178: ch = 0xD9; break; - case 0x0192: ch = 0xC4; break; - case 0x02C6: ch = 0xF6; break; - case 0x02C7: ch = 0xFF; break; - case 0x02D8: ch = 0xF9; break; - case 0x02D9: ch = 0xFA; break; - case 0x02DA: ch = 0xFB; break; - case 0x02DB: ch = 0xFE; break; - case 0x02DC: ch = 0xF7; break; - case 0x02DD: ch = 0xFD; break; - case 0x03C0: ch = 0xB9; break; - case 0x2013: ch = 0xD0; break; - case 0x2014: ch = 0xD1; break; - case 0x2018: ch = 0xD4; break; - case 0x2019: ch = 0xD5; break; - case 0x201A: ch = 0xE2; break; - case 0x201C: ch = 0xD2; break; - case 0x201D: ch = 0xD3; break; - case 0x201E: ch = 0xE3; break; - case 0x2020: ch = 0xA0; break; - case 0x2021: ch = 0xE0; break; - case 0x2022: ch = 0xA5; break; - case 0x2026: ch = 0xC9; break; - case 0x2030: ch = 0xE4; break; - case 0x2039: ch = 0xDC; break; - case 0x203A: ch = 0xDD; break; - case 0x2044: ch = 0xDA; break; - case 0x2122: ch = 0xAA; break; - case 0x2126: ch = 0xBD; break; - case 0x2202: ch = 0xB6; break; - case 0x2206: ch = 0xC6; break; - case 0x220F: ch = 0xB8; break; - case 0x2211: ch = 0xB7; break; - case 0x221A: ch = 0xC3; break; - case 0x221E: ch = 0xB0; break; - case 0x222B: ch = 0xBA; break; - case 0x2248: ch = 0xC5; break; - case 0x2260: ch = 0xAD; break; - case 0x2264: ch = 0xB2; break; - case 0x2265: ch = 0xB3; break; - case 0x2318: ch = 0x11; break; - case 0x25CA: ch = 0xD7; break; - case 0x2666: ch = 0x13; break; - case 0x2713: ch = 0x12; break; - case 0xF8FF: ch = 0xF0; break; - case 0xFB01: ch = 0xDE; break; - case 0xFB02: ch = 0xDF; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP10000 [Serializable] diff --git a/mcs/class/I18N/West/CP10079.cs b/mcs/class/I18N/West/CP10079.cs index f137799ac2d..f7dbf0be626 100644 --- a/mcs/class/I18N/West/CP10079.cs +++ b/mcs/class/I18N/West/CP10079.cs @@ -97,12 +97,11 @@ public class CP10079 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP10079 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP10079 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -291,154 +290,6 @@ public class CP10079 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x00A2: - case 0x00A3: - case 0x00A9: - case 0x00B1: - case 0x00B5: - case 0x00DE: - break; - case 0x00A0: ch = 0xCA; break; - case 0x00A1: ch = 0xC1; break; - case 0x00A4: ch = 0xDB; break; - case 0x00A5: ch = 0xB4; break; - case 0x00A7: ch = 0xA4; break; - case 0x00A8: ch = 0xAC; break; - case 0x00AA: ch = 0xBB; break; - case 0x00AB: ch = 0xC7; break; - case 0x00AC: ch = 0xC2; break; - case 0x00AE: ch = 0xA8; break; - case 0x00AF: ch = 0xF8; break; - case 0x00B0: ch = 0xA1; break; - case 0x00B4: ch = 0xAB; break; - case 0x00B6: ch = 0xA6; break; - case 0x00B7: ch = 0xE1; break; - case 0x00B8: ch = 0xFC; break; - case 0x00BA: ch = 0xBC; break; - case 0x00BB: ch = 0xC8; break; - case 0x00BF: ch = 0xC0; break; - case 0x00C0: ch = 0xCB; break; - case 0x00C1: ch = 0xE7; break; - case 0x00C2: ch = 0xE5; break; - case 0x00C3: ch = 0xCC; break; - case 0x00C4: ch = 0x80; break; - case 0x00C5: ch = 0x81; break; - case 0x00C6: ch = 0xAE; break; - case 0x00C7: ch = 0x82; break; - case 0x00C8: ch = 0xE9; break; - case 0x00C9: ch = 0x83; break; - case 0x00CA: ch = 0xE6; break; - case 0x00CB: ch = 0xE8; break; - case 0x00CC: ch = 0xED; break; - case 0x00CD: ch = 0xEA; break; - case 0x00CE: ch = 0xEB; break; - case 0x00CF: ch = 0xEC; break; - case 0x00D0: ch = 0xDC; break; - case 0x00D1: ch = 0x84; break; - case 0x00D2: ch = 0xF1; break; - case 0x00D3: ch = 0xEE; break; - case 0x00D4: ch = 0xEF; break; - case 0x00D5: ch = 0xCD; break; - case 0x00D6: ch = 0x85; break; - case 0x00D8: ch = 0xAF; break; - case 0x00D9: ch = 0xF4; break; - case 0x00DA: ch = 0xF2; break; - case 0x00DB: ch = 0xF3; break; - case 0x00DC: ch = 0x86; break; - case 0x00DD: ch = 0xA0; break; - case 0x00DF: ch = 0xA7; break; - case 0x00E0: ch = 0x88; break; - case 0x00E1: ch = 0x87; break; - case 0x00E2: ch = 0x89; break; - case 0x00E3: ch = 0x8B; break; - case 0x00E4: ch = 0x8A; break; - case 0x00E5: ch = 0x8C; break; - case 0x00E6: ch = 0xBE; break; - case 0x00E7: ch = 0x8D; break; - case 0x00E8: ch = 0x8F; break; - case 0x00E9: ch = 0x8E; break; - case 0x00EA: ch = 0x90; break; - case 0x00EB: ch = 0x91; break; - case 0x00EC: ch = 0x93; break; - case 0x00ED: ch = 0x92; break; - case 0x00EE: ch = 0x94; break; - case 0x00EF: ch = 0x95; break; - case 0x00F0: ch = 0xDD; break; - case 0x00F1: ch = 0x96; break; - case 0x00F2: ch = 0x98; break; - case 0x00F3: ch = 0x97; break; - case 0x00F4: ch = 0x99; break; - case 0x00F5: ch = 0x9B; break; - case 0x00F6: ch = 0x9A; break; - case 0x00F7: ch = 0xD6; break; - case 0x00F8: ch = 0xBF; break; - case 0x00F9: ch = 0x9D; break; - case 0x00FA: ch = 0x9C; break; - case 0x00FB: ch = 0x9E; break; - case 0x00FC: ch = 0x9F; break; - case 0x00FD: ch = 0xE0; break; - case 0x00FE: ch = 0xDF; break; - case 0x00FF: ch = 0xD8; break; - case 0x0131: ch = 0xF5; break; - case 0x0152: ch = 0xCE; break; - case 0x0153: ch = 0xCF; break; - case 0x0178: ch = 0xD9; break; - case 0x0192: ch = 0xC4; break; - case 0x02C6: ch = 0xF6; break; - case 0x02C7: ch = 0xFF; break; - case 0x02D8: ch = 0xF9; break; - case 0x02D9: ch = 0xFA; break; - case 0x02DA: ch = 0xFB; break; - case 0x02DB: ch = 0xFE; break; - case 0x02DC: ch = 0xF7; break; - case 0x02DD: ch = 0xFD; break; - case 0x03C0: ch = 0xB9; break; - case 0x2013: ch = 0xD0; break; - case 0x2014: ch = 0xD1; break; - case 0x2018: ch = 0xD4; break; - case 0x2019: ch = 0xD5; break; - case 0x201A: ch = 0xE2; break; - case 0x201C: ch = 0xD2; break; - case 0x201D: ch = 0xD3; break; - case 0x201E: ch = 0xE3; break; - case 0x2022: ch = 0xA5; break; - case 0x2026: ch = 0xC9; break; - case 0x2030: ch = 0xE4; break; - case 0x2044: ch = 0xDA; break; - case 0x2122: ch = 0xAA; break; - case 0x2126: ch = 0xBD; break; - case 0x2202: ch = 0xB6; break; - case 0x2206: ch = 0xC6; break; - case 0x220F: ch = 0xB8; break; - case 0x2211: ch = 0xB7; break; - case 0x221A: ch = 0xC3; break; - case 0x221E: ch = 0xB0; break; - case 0x222B: ch = 0xBA; break; - case 0x2248: ch = 0xC5; break; - case 0x2260: ch = 0xAD; break; - case 0x2264: ch = 0xB2; break; - case 0x2265: ch = 0xB3; break; - case 0x25CA: ch = 0xD7; break; - case 0xF8FF: ch = 0xF0; break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP10079 [Serializable] diff --git a/mcs/class/I18N/West/CP1250.cs b/mcs/class/I18N/West/CP1250.cs index cb9c3128a86..1cb040cebce 100644 --- a/mcs/class/I18N/West/CP1250.cs +++ b/mcs/class/I18N/West/CP1250.cs @@ -97,12 +97,11 @@ public class CP1250 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1250 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1250 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -301,165 +300,6 @@ public class CP1250 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x0081: - case 0x0083: - case 0x0088: - case 0x0090: - case 0x0098: - case 0x00A0: - case 0x00A4: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00B0: - case 0x00B1: - case 0x00B4: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00B8: - case 0x00BB: - case 0x00C1: - case 0x00C2: - case 0x00C4: - case 0x00C7: - case 0x00C9: - case 0x00CB: - case 0x00CD: - case 0x00CE: - case 0x00D3: - case 0x00D4: - case 0x00D6: - case 0x00D7: - case 0x00DA: - case 0x00DC: - case 0x00DD: - case 0x00DF: - case 0x00E1: - case 0x00E2: - case 0x00E4: - case 0x00E7: - case 0x00E9: - case 0x00EB: - case 0x00ED: - case 0x00EE: - case 0x00F3: - case 0x00F4: - case 0x00F6: - case 0x00F7: - case 0x00FA: - case 0x00FC: - case 0x00FD: - break; - case 0x0102: ch = 0xC3; break; - case 0x0103: ch = 0xE3; break; - case 0x0104: ch = 0xA5; break; - case 0x0105: ch = 0xB9; break; - case 0x0106: ch = 0xC6; break; - case 0x0107: ch = 0xE6; break; - case 0x010C: ch = 0xC8; break; - case 0x010D: ch = 0xE8; break; - case 0x010E: ch = 0xCF; break; - case 0x010F: ch = 0xEF; break; - case 0x0110: ch = 0xD0; break; - case 0x0111: ch = 0xF0; break; - case 0x0118: ch = 0xCA; break; - case 0x0119: ch = 0xEA; break; - case 0x011A: ch = 0xCC; break; - case 0x011B: ch = 0xEC; break; - case 0x0139: ch = 0xC5; break; - case 0x013A: ch = 0xE5; break; - case 0x013D: ch = 0xBC; break; - case 0x013E: ch = 0xBE; break; - case 0x0141: ch = 0xA3; break; - case 0x0142: ch = 0xB3; break; - case 0x0143: ch = 0xD1; break; - case 0x0144: ch = 0xF1; break; - case 0x0147: ch = 0xD2; break; - case 0x0148: ch = 0xF2; break; - case 0x0150: ch = 0xD5; break; - case 0x0151: ch = 0xF5; break; - case 0x0154: ch = 0xC0; break; - case 0x0155: ch = 0xE0; break; - case 0x0158: ch = 0xD8; break; - case 0x0159: ch = 0xF8; break; - case 0x015A: ch = 0x8C; break; - case 0x015B: ch = 0x9C; break; - case 0x015E: ch = 0xAA; break; - case 0x015F: ch = 0xBA; break; - case 0x0160: ch = 0x8A; break; - case 0x0161: ch = 0x9A; break; - case 0x0162: ch = 0xDE; break; - case 0x0163: ch = 0xFE; break; - case 0x0164: ch = 0x8D; break; - case 0x0165: ch = 0x9D; break; - case 0x016E: ch = 0xD9; break; - case 0x016F: ch = 0xF9; break; - case 0x0170: ch = 0xDB; break; - case 0x0171: ch = 0xFB; break; - case 0x0179: ch = 0x8F; break; - case 0x017A: ch = 0x9F; break; - case 0x017B: ch = 0xAF; break; - case 0x017C: ch = 0xBF; break; - case 0x017D: ch = 0x8E; break; - case 0x017E: ch = 0x9E; break; - case 0x02C7: ch = 0xA1; break; - case 0x02D8: ch = 0xA2; break; - case 0x02D9: ch = 0xFF; break; - case 0x02DB: ch = 0xB2; break; - case 0x02DD: ch = 0xBD; break; - case 0x2013: ch = 0x96; break; - case 0x2014: ch = 0x97; break; - case 0x2018: ch = 0x91; break; - case 0x2019: ch = 0x92; break; - case 0x201A: ch = 0x82; break; - case 0x201C: ch = 0x93; break; - case 0x201D: ch = 0x94; break; - case 0x201E: ch = 0x84; break; - case 0x2020: ch = 0x86; break; - case 0x2021: ch = 0x87; break; - case 0x2022: ch = 0x95; break; - case 0x2026: ch = 0x85; break; - case 0x2030: ch = 0x89; break; - case 0x2039: ch = 0x8B; break; - case 0x203A: ch = 0x9B; break; - case 0x20AC: ch = 0x80; break; - case 0x2122: ch = 0x99; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1250 [Serializable] diff --git a/mcs/class/I18N/West/CP1252.cs b/mcs/class/I18N/West/CP1252.cs index 917d4fabd0b..3918b297729 100644 --- a/mcs/class/I18N/West/CP1252.cs +++ b/mcs/class/I18N/West/CP1252.cs @@ -97,12 +97,11 @@ public class CP1252 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1252 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1252 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -301,165 +300,6 @@ public class CP1252 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x0081: - case 0x008D: - case 0x008F: - case 0x0090: - case 0x009D: - case 0x00A0: - case 0x00A1: - case 0x00A2: - case 0x00A3: - case 0x00A4: - case 0x00A5: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AA: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00AF: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00B8: - case 0x00B9: - case 0x00BA: - case 0x00BB: - case 0x00BC: - case 0x00BD: - case 0x00BE: - case 0x00BF: - case 0x00C0: - case 0x00C1: - case 0x00C2: - case 0x00C3: - case 0x00C4: - case 0x00C5: - case 0x00C6: - case 0x00C7: - case 0x00C8: - case 0x00C9: - case 0x00CA: - case 0x00CB: - case 0x00CC: - case 0x00CD: - case 0x00CE: - case 0x00CF: - case 0x00D0: - case 0x00D1: - case 0x00D2: - case 0x00D3: - case 0x00D4: - case 0x00D5: - case 0x00D6: - case 0x00D7: - case 0x00D8: - case 0x00D9: - case 0x00DA: - case 0x00DB: - case 0x00DC: - case 0x00DD: - case 0x00DE: - case 0x00DF: - case 0x00E0: - case 0x00E1: - case 0x00E2: - case 0x00E3: - case 0x00E4: - case 0x00E5: - case 0x00E6: - case 0x00E7: - case 0x00E8: - case 0x00E9: - case 0x00EA: - case 0x00EB: - case 0x00EC: - case 0x00ED: - case 0x00EE: - case 0x00EF: - case 0x00F0: - case 0x00F1: - case 0x00F2: - case 0x00F3: - case 0x00F4: - case 0x00F5: - case 0x00F6: - case 0x00F7: - case 0x00F8: - case 0x00F9: - case 0x00FA: - case 0x00FB: - case 0x00FC: - case 0x00FD: - case 0x00FE: - case 0x00FF: - break; - case 0x0152: ch = 0x8C; break; - case 0x0153: ch = 0x9C; break; - case 0x0160: ch = 0x8A; break; - case 0x0161: ch = 0x9A; break; - case 0x0178: ch = 0x9F; break; - case 0x017D: ch = 0x8E; break; - case 0x017E: ch = 0x9E; break; - case 0x0192: ch = 0x83; break; - case 0x02C6: ch = 0x88; break; - case 0x02DC: ch = 0x98; break; - case 0x2013: ch = 0x96; break; - case 0x2014: ch = 0x97; break; - case 0x2018: ch = 0x91; break; - case 0x2019: ch = 0x92; break; - case 0x201A: ch = 0x82; break; - case 0x201C: ch = 0x93; break; - case 0x201D: ch = 0x94; break; - case 0x201E: ch = 0x84; break; - case 0x2020: ch = 0x86; break; - case 0x2021: ch = 0x87; break; - case 0x2022: ch = 0x95; break; - case 0x2026: ch = 0x85; break; - case 0x2030: ch = 0x89; break; - case 0x2039: ch = 0x8B; break; - case 0x203A: ch = 0x9B; break; - case 0x20AC: ch = 0x80; break; - case 0x2122: ch = 0x99; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1252 [Serializable] diff --git a/mcs/class/I18N/West/CP1253.cs b/mcs/class/I18N/West/CP1253.cs index f6415499b16..cb2cd5e8094 100644 --- a/mcs/class/I18N/West/CP1253.cs +++ b/mcs/class/I18N/West/CP1253.cs @@ -97,12 +97,11 @@ public class CP1253 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP1253 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP1253 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -304,168 +303,6 @@ public class CP1253 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x0081: - case 0x0088: - case 0x008A: - case 0x008C: - case 0x008D: - case 0x008E: - case 0x008F: - case 0x0090: - case 0x0098: - case 0x009A: - case 0x009C: - case 0x009D: - case 0x009E: - case 0x009F: - case 0x00A0: - case 0x00A3: - case 0x00A4: - case 0x00A5: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AA: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00BB: - case 0x00BD: - break; - case 0x0192: ch = 0x83; break; - case 0x0384: ch = 0xB4; break; - case 0x0385: ch = 0xA1; break; - case 0x0386: ch = 0xA2; break; - case 0x0388: ch = 0xB8; break; - case 0x0389: ch = 0xB9; break; - case 0x038A: ch = 0xBA; break; - case 0x038C: ch = 0xBC; break; - case 0x038E: - case 0x038F: - case 0x0390: - case 0x0391: - case 0x0392: - case 0x0393: - case 0x0394: - case 0x0395: - case 0x0396: - case 0x0397: - case 0x0398: - case 0x0399: - case 0x039A: - case 0x039B: - case 0x039C: - case 0x039D: - case 0x039E: - case 0x039F: - case 0x03A0: - case 0x03A1: - ch -= 0x02D0; - break; - case 0x03A3: - case 0x03A4: - case 0x03A5: - case 0x03A6: - case 0x03A7: - case 0x03A8: - case 0x03A9: - case 0x03AA: - case 0x03AB: - case 0x03AC: - case 0x03AD: - case 0x03AE: - case 0x03AF: - case 0x03B0: - case 0x03B1: - case 0x03B2: - case 0x03B3: - case 0x03B4: - case 0x03B5: - case 0x03B6: - case 0x03B7: - case 0x03B8: - case 0x03B9: - case 0x03BA: - case 0x03BB: - case 0x03BC: - case 0x03BD: - case 0x03BE: - case 0x03BF: - case 0x03C0: - case 0x03C1: - case 0x03C2: - case 0x03C3: - case 0x03C4: - case 0x03C5: - case 0x03C6: - case 0x03C7: - case 0x03C8: - case 0x03C9: - case 0x03CA: - case 0x03CB: - case 0x03CC: - case 0x03CD: - case 0x03CE: - ch -= 0x02D0; - break; - case 0x03D5: ch = 0xF6; break; - case 0x2013: ch = 0x96; break; - case 0x2014: ch = 0x97; break; - case 0x2015: ch = 0xAF; break; - case 0x2018: ch = 0x91; break; - case 0x2019: ch = 0x92; break; - case 0x201A: ch = 0x82; break; - case 0x201C: ch = 0x93; break; - case 0x201D: ch = 0x94; break; - case 0x201E: ch = 0x84; break; - case 0x2020: ch = 0x86; break; - case 0x2021: ch = 0x87; break; - case 0x2022: ch = 0x95; break; - case 0x2026: ch = 0x85; break; - case 0x2030: ch = 0x89; break; - case 0x2039: ch = 0x8B; break; - case 0x203A: ch = 0x9B; break; - case 0x20AC: ch = 0x80; break; - case 0x2122: ch = 0x99; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP1253 [Serializable] diff --git a/mcs/class/I18N/West/CP28592.cs b/mcs/class/I18N/West/CP28592.cs index 965287b2e14..06b2fd150c4 100644 --- a/mcs/class/I18N/West/CP28592.cs +++ b/mcs/class/I18N/West/CP28592.cs @@ -97,12 +97,11 @@ public class CP28592 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP28592 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP28592 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -337,201 +336,6 @@ public class CP28592 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 161) switch(ch) - { - case 0x00A4: - case 0x00A7: - case 0x00A8: - case 0x00AD: - case 0x00B0: - case 0x00B4: - case 0x00B8: - case 0x00C1: - case 0x00C2: - case 0x00C4: - case 0x00C7: - case 0x00C9: - case 0x00CB: - case 0x00CD: - case 0x00CE: - case 0x00D0: - case 0x00D3: - case 0x00D4: - case 0x00D6: - case 0x00D7: - case 0x00DA: - case 0x00DC: - case 0x00DD: - case 0x00DF: - case 0x00E1: - case 0x00E2: - case 0x00E4: - case 0x00E7: - case 0x00E9: - case 0x00EB: - case 0x00ED: - case 0x00EE: - case 0x00F3: - case 0x00F4: - case 0x00F6: - case 0x00F7: - case 0x00FA: - case 0x00FC: - case 0x00FD: - break; - case 0x00A2: ch = 0x8D; break; - case 0x00A5: ch = 0x8E; break; - case 0x00A9: ch = 0x88; break; - case 0x00AE: ch = 0x9F; break; - case 0x00B6: ch = 0x14; break; - case 0x0102: ch = 0xC3; break; - case 0x0103: ch = 0xE3; break; - case 0x0104: ch = 0xA1; break; - case 0x0105: ch = 0xB1; break; - case 0x0106: ch = 0xC6; break; - case 0x0107: ch = 0xE6; break; - case 0x010C: ch = 0xC8; break; - case 0x010D: ch = 0xE8; break; - case 0x010E: ch = 0xCF; break; - case 0x010F: ch = 0xEF; break; - case 0x0110: ch = 0xD0; break; - case 0x0111: ch = 0xF0; break; - case 0x0118: ch = 0xCA; break; - case 0x0119: ch = 0xEA; break; - case 0x011A: ch = 0xCC; break; - case 0x011B: ch = 0xEC; break; - case 0x0139: ch = 0xC5; break; - case 0x013A: ch = 0xE5; break; - case 0x013D: ch = 0xA5; break; - case 0x013E: ch = 0xB5; break; - case 0x0141: ch = 0xA3; break; - case 0x0142: ch = 0xB3; break; - case 0x0143: ch = 0xD1; break; - case 0x0144: ch = 0xF1; break; - case 0x0147: ch = 0xD2; break; - case 0x0148: ch = 0xF2; break; - case 0x0150: ch = 0xD5; break; - case 0x0151: ch = 0xF5; break; - case 0x0154: ch = 0xC0; break; - case 0x0155: ch = 0xE0; break; - case 0x0158: ch = 0xD8; break; - case 0x0159: ch = 0xF8; break; - case 0x015A: ch = 0xA6; break; - case 0x015B: ch = 0xB6; break; - case 0x015E: ch = 0xAA; break; - case 0x015F: ch = 0xBA; break; - case 0x0160: ch = 0xA9; break; - case 0x0161: ch = 0xB9; break; - case 0x0162: ch = 0xDE; break; - case 0x0163: ch = 0xFE; break; - case 0x0164: ch = 0xAB; break; - case 0x0165: ch = 0xBB; break; - case 0x016E: ch = 0xD9; break; - case 0x016F: ch = 0xF9; break; - case 0x0170: ch = 0xDB; break; - case 0x0171: ch = 0xFB; break; - case 0x0179: ch = 0xAC; break; - case 0x017A: ch = 0xBC; break; - case 0x017B: ch = 0xAF; break; - case 0x017C: ch = 0xBF; break; - case 0x017D: ch = 0xAE; break; - case 0x017E: ch = 0xBE; break; - case 0x02C7: ch = 0xB7; break; - case 0x02D8: ch = 0xA2; break; - case 0x02D9: ch = 0xFF; break; - case 0x02DB: ch = 0xB2; break; - case 0x02DD: ch = 0xBD; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x221F: ch = 0x1C; break; - case 0x2500: ch = 0x94; break; - case 0x2502: ch = 0x83; break; - case 0x250C: ch = 0x86; break; - case 0x2510: ch = 0x8F; break; - case 0x2514: ch = 0x90; break; - case 0x2518: ch = 0x85; break; - case 0x251C: ch = 0x93; break; - case 0x2524: ch = 0x84; break; - case 0x252C: ch = 0x92; break; - case 0x2534: ch = 0x91; break; - case 0x253C: ch = 0x95; break; - case 0x2550: ch = 0x9D; break; - case 0x2551: ch = 0x8A; break; - case 0x2554: ch = 0x99; break; - case 0x2557: ch = 0x8B; break; - case 0x255A: ch = 0x98; break; - case 0x255D: ch = 0x8C; break; - case 0x2560: ch = 0x9C; break; - case 0x2563: ch = 0x89; break; - case 0x2566: ch = 0x9B; break; - case 0x2569: ch = 0x9A; break; - case 0x256C: ch = 0x9E; break; - case 0x2580: ch = 0x97; break; - case 0x2584: ch = 0x96; break; - case 0x2588: ch = 0x87; break; - case 0x2591: ch = 0x80; break; - case 0x2592: ch = 0x81; break; - case 0x2593: ch = 0x82; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266C: ch = 0x0E; break; - case 0xFFE8: ch = 0x83; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP28592 [Serializable] diff --git a/mcs/class/I18N/West/CP28593.cs b/mcs/class/I18N/West/CP28593.cs index c9316841eff..557749b73c4 100644 --- a/mcs/class/I18N/West/CP28593.cs +++ b/mcs/class/I18N/West/CP28593.cs @@ -97,12 +97,11 @@ public class CP28593 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP28593 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP28593 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -261,125 +260,6 @@ public class CP28593 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 161) switch(ch) - { - case 0x00A3: - case 0x00A4: - case 0x00A7: - case 0x00A8: - case 0x00AD: - case 0x00B0: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B5: - case 0x00B7: - case 0x00B8: - case 0x00BD: - case 0x00C0: - case 0x00C1: - case 0x00C2: - case 0x00C4: - case 0x00C7: - case 0x00C8: - case 0x00C9: - case 0x00CA: - case 0x00CB: - case 0x00CC: - case 0x00CD: - case 0x00CE: - case 0x00CF: - case 0x00D1: - case 0x00D2: - case 0x00D3: - case 0x00D4: - case 0x00D6: - case 0x00D7: - case 0x00D9: - case 0x00DA: - case 0x00DB: - case 0x00DC: - case 0x00DF: - case 0x00E0: - case 0x00E1: - case 0x00E2: - case 0x00E4: - case 0x00E7: - case 0x00E8: - case 0x00E9: - case 0x00EA: - case 0x00EB: - case 0x00EC: - case 0x00ED: - case 0x00EE: - case 0x00EF: - case 0x00F1: - case 0x00F2: - case 0x00F3: - case 0x00F4: - case 0x00F6: - case 0x00F7: - case 0x00F9: - case 0x00FA: - case 0x00FB: - case 0x00FC: - break; - case 0x0108: ch = 0xC6; break; - case 0x0109: ch = 0xE6; break; - case 0x010A: ch = 0xC5; break; - case 0x010B: ch = 0xE5; break; - case 0x011C: ch = 0xD8; break; - case 0x011D: ch = 0xF8; break; - case 0x011E: ch = 0xAB; break; - case 0x011F: ch = 0xBB; break; - case 0x0120: ch = 0xD5; break; - case 0x0121: ch = 0xF5; break; - case 0x0124: ch = 0xA6; break; - case 0x0125: ch = 0xB6; break; - case 0x0126: ch = 0xA1; break; - case 0x0127: ch = 0xB1; break; - case 0x0130: ch = 0xA9; break; - case 0x0131: ch = 0xB9; break; - case 0x0134: ch = 0xAC; break; - case 0x0135: ch = 0xBC; break; - case 0x015C: ch = 0xDE; break; - case 0x015D: ch = 0xFE; break; - case 0x015E: ch = 0xAA; break; - case 0x015F: ch = 0xBA; break; - case 0x016C: ch = 0xDD; break; - case 0x016D: ch = 0xFD; break; - case 0x017B: ch = 0xAF; break; - case 0x017C: ch = 0xBF; break; - case 0x02D8: ch = 0xA2; break; - case 0x02D9: ch = 0xFF; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP28593 [Serializable] diff --git a/mcs/class/I18N/West/CP28597.cs b/mcs/class/I18N/West/CP28597.cs index 58fded6e30c..9bd7402edd2 100644 --- a/mcs/class/I18N/West/CP28597.cs +++ b/mcs/class/I18N/West/CP28597.cs @@ -97,12 +97,11 @@ public class CP28597 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP28597 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP28597 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -271,135 +270,6 @@ public class CP28597 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 161) switch(ch) - { - case 0x00A3: - case 0x00A6: - case 0x00A7: - case 0x00A8: - case 0x00A9: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B4: - case 0x00B7: - case 0x00BB: - case 0x00BD: - break; - case 0x0385: - case 0x0386: - case 0x0387: - case 0x0388: - case 0x0389: - case 0x038A: - ch -= 0x02D0; - break; - case 0x038C: ch = 0xBC; break; - case 0x038E: - case 0x038F: - case 0x0390: - case 0x0391: - case 0x0392: - case 0x0393: - case 0x0394: - case 0x0395: - case 0x0396: - case 0x0397: - case 0x0398: - case 0x0399: - case 0x039A: - case 0x039B: - case 0x039C: - case 0x039D: - case 0x039E: - case 0x039F: - case 0x03A0: - case 0x03A1: - ch -= 0x02D0; - break; - case 0x03A3: - case 0x03A4: - case 0x03A5: - case 0x03A6: - case 0x03A7: - case 0x03A8: - case 0x03A9: - case 0x03AA: - case 0x03AB: - case 0x03AC: - case 0x03AD: - case 0x03AE: - case 0x03AF: - case 0x03B0: - case 0x03B1: - case 0x03B2: - case 0x03B3: - case 0x03B4: - case 0x03B5: - case 0x03B6: - case 0x03B7: - case 0x03B8: - case 0x03B9: - case 0x03BA: - case 0x03BB: - case 0x03BC: - case 0x03BD: - case 0x03BE: - case 0x03BF: - case 0x03C0: - case 0x03C1: - case 0x03C2: - case 0x03C3: - case 0x03C4: - case 0x03C5: - case 0x03C6: - case 0x03C7: - case 0x03C8: - case 0x03C9: - case 0x03CA: - case 0x03CB: - case 0x03CC: - case 0x03CD: - case 0x03CE: - ch -= 0x02D0; - break; - case 0x03D5: ch = 0xF6; break; - case 0x2015: ch = 0xAF; break; - case 0x2018: ch = 0xA1; break; - case 0x2019: ch = 0xA2; break; - case 0x20AC: ch = 0xA4; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP28597 [Serializable] diff --git a/mcs/class/I18N/West/CP28605.cs b/mcs/class/I18N/West/CP28605.cs index 56531602ee4..06bb833753e 100644 --- a/mcs/class/I18N/West/CP28605.cs +++ b/mcs/class/I18N/West/CP28605.cs @@ -97,12 +97,11 @@ public class CP28605 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP28605 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP28605 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -265,129 +264,6 @@ public class CP28605 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 164) switch(ch) - { - case 0x00A5: - case 0x00A7: - case 0x00A9: - case 0x00AA: - case 0x00AB: - case 0x00AC: - case 0x00AD: - case 0x00AE: - case 0x00AF: - case 0x00B0: - case 0x00B1: - case 0x00B2: - case 0x00B3: - case 0x00B5: - case 0x00B6: - case 0x00B7: - case 0x00B9: - case 0x00BA: - case 0x00BB: - case 0x00BF: - case 0x00C0: - case 0x00C1: - case 0x00C2: - case 0x00C3: - case 0x00C4: - case 0x00C5: - case 0x00C6: - case 0x00C7: - case 0x00C8: - case 0x00C9: - case 0x00CA: - case 0x00CB: - case 0x00CC: - case 0x00CD: - case 0x00CE: - case 0x00CF: - case 0x00D0: - case 0x00D1: - case 0x00D2: - case 0x00D3: - case 0x00D4: - case 0x00D5: - case 0x00D6: - case 0x00D7: - case 0x00D8: - case 0x00D9: - case 0x00DA: - case 0x00DB: - case 0x00DC: - case 0x00DD: - case 0x00DE: - case 0x00DF: - case 0x00E0: - case 0x00E1: - case 0x00E2: - case 0x00E3: - case 0x00E4: - case 0x00E5: - case 0x00E6: - case 0x00E7: - case 0x00E8: - case 0x00E9: - case 0x00EA: - case 0x00EB: - case 0x00EC: - case 0x00ED: - case 0x00EE: - case 0x00EF: - case 0x00F0: - case 0x00F1: - case 0x00F2: - case 0x00F3: - case 0x00F4: - case 0x00F5: - case 0x00F6: - case 0x00F7: - case 0x00F8: - case 0x00F9: - case 0x00FA: - case 0x00FB: - case 0x00FC: - case 0x00FD: - case 0x00FE: - case 0x00FF: - break; - case 0x0152: ch = 0xBC; break; - case 0x0153: ch = 0xBD; break; - case 0x0160: ch = 0xA6; break; - case 0x0161: ch = 0xA8; break; - case 0x0178: ch = 0xBE; break; - case 0x017D: ch = 0xB4; break; - case 0x017E: ch = 0xB8; break; - case 0x20AC: ch = 0xA4; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP28605 [Serializable] diff --git a/mcs/class/I18N/West/CP437.cs b/mcs/class/I18N/West/CP437.cs index b1c7a26e8b0..fcc4008ac7a 100644 --- a/mcs/class/I18N/West/CP437.cs +++ b/mcs/class/I18N/West/CP437.cs @@ -97,12 +97,11 @@ public class CP437 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP437 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP437 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -770,633 +769,6 @@ public class CP437 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 128) switch(ch) - { - case 0x00A0: ch = 0xFF; break; - case 0x00A1: ch = 0xAD; break; - case 0x00A2: ch = 0x9B; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A4: ch = 0x0F; break; - case 0x00A5: ch = 0x9D; break; - case 0x00A6: ch = 0xDD; break; - case 0x00A7: ch = 0x15; break; - case 0x00A8: ch = 0x22; break; - case 0x00A9: ch = 0x63; break; - case 0x00AA: ch = 0xA6; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0xAA; break; - case 0x00AD: ch = 0x2D; break; - case 0x00AE: ch = 0x72; break; - case 0x00AF: ch = 0x5F; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0xFD; break; - case 0x00B3: ch = 0x33; break; - case 0x00B4: ch = 0x27; break; - case 0x00B5: ch = 0xE6; break; - case 0x00B6: ch = 0x14; break; - case 0x00B7: ch = 0xFA; break; - case 0x00B8: ch = 0x2C; break; - case 0x00B9: ch = 0x31; break; - case 0x00BA: ch = 0xA7; break; - case 0x00BB: ch = 0xAF; break; - case 0x00BC: ch = 0xAC; break; - case 0x00BD: ch = 0xAB; break; - case 0x00BE: ch = 0x5F; break; - case 0x00BF: ch = 0xA8; break; - case 0x00C0: ch = 0x41; break; - case 0x00C1: ch = 0x41; break; - case 0x00C2: ch = 0x41; break; - case 0x00C3: ch = 0x41; break; - case 0x00C4: ch = 0x8E; break; - case 0x00C5: ch = 0x8F; break; - case 0x00C6: ch = 0x92; break; - case 0x00C7: ch = 0x80; break; - case 0x00C8: ch = 0x45; break; - case 0x00C9: ch = 0x90; break; - case 0x00CA: ch = 0x45; break; - case 0x00CB: ch = 0x45; break; - case 0x00CC: ch = 0x49; break; - case 0x00CD: ch = 0x49; break; - case 0x00CE: ch = 0x49; break; - case 0x00CF: ch = 0x49; break; - case 0x00D0: ch = 0x44; break; - case 0x00D1: ch = 0xA5; break; - case 0x00D2: ch = 0x4F; break; - case 0x00D3: ch = 0x4F; break; - case 0x00D4: ch = 0x4F; break; - case 0x00D5: ch = 0x4F; break; - case 0x00D6: ch = 0x99; break; - case 0x00D7: ch = 0x78; break; - case 0x00D8: ch = 0x4F; break; - case 0x00D9: ch = 0x55; break; - case 0x00DA: ch = 0x55; break; - case 0x00DB: ch = 0x55; break; - case 0x00DC: ch = 0x9A; break; - case 0x00DD: ch = 0x59; break; - case 0x00DE: ch = 0x5F; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E0: ch = 0x85; break; - case 0x00E1: ch = 0xA0; break; - case 0x00E2: ch = 0x83; break; - case 0x00E3: ch = 0x61; break; - case 0x00E4: ch = 0x84; break; - case 0x00E5: ch = 0x86; break; - case 0x00E6: ch = 0x91; break; - case 0x00E7: ch = 0x87; break; - case 0x00E8: ch = 0x8A; break; - case 0x00E9: ch = 0x82; break; - case 0x00EA: ch = 0x88; break; - case 0x00EB: ch = 0x89; break; - case 0x00EC: ch = 0x8D; break; - case 0x00ED: ch = 0xA1; break; - case 0x00EE: ch = 0x8C; break; - case 0x00EF: ch = 0x8B; break; - case 0x00F0: ch = 0x64; break; - case 0x00F1: ch = 0xA4; break; - case 0x00F2: ch = 0x95; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F4: ch = 0x93; break; - case 0x00F5: ch = 0x6F; break; - case 0x00F6: ch = 0x94; break; - case 0x00F7: ch = 0xF6; break; - case 0x00F8: ch = 0x6F; break; - case 0x00F9: ch = 0x97; break; - case 0x00FA: ch = 0xA3; break; - case 0x00FB: ch = 0x96; break; - case 0x00FC: ch = 0x81; break; - case 0x00FD: ch = 0x79; break; - case 0x00FE: ch = 0x5F; break; - case 0x00FF: ch = 0x98; break; - case 0x0100: ch = 0x41; break; - case 0x0101: ch = 0x61; break; - case 0x0102: ch = 0x41; break; - case 0x0103: ch = 0x61; break; - case 0x0104: ch = 0x41; break; - case 0x0105: ch = 0x61; break; - case 0x0106: ch = 0x43; break; - case 0x0107: ch = 0x63; break; - case 0x0108: ch = 0x43; break; - case 0x0109: ch = 0x63; break; - case 0x010A: ch = 0x43; break; - case 0x010B: ch = 0x63; break; - case 0x010C: ch = 0x43; break; - case 0x010D: ch = 0x63; break; - case 0x010E: ch = 0x44; break; - case 0x010F: ch = 0x64; break; - case 0x0110: ch = 0x44; break; - case 0x0111: ch = 0x64; break; - case 0x0112: ch = 0x45; break; - case 0x0113: ch = 0x65; break; - case 0x0114: ch = 0x45; break; - case 0x0115: ch = 0x65; break; - case 0x0116: ch = 0x45; break; - case 0x0117: ch = 0x65; break; - case 0x0118: ch = 0x45; break; - case 0x0119: ch = 0x65; break; - case 0x011A: ch = 0x45; break; - case 0x011B: ch = 0x65; break; - case 0x011C: ch = 0x47; break; - case 0x011D: ch = 0x67; break; - case 0x011E: ch = 0x47; break; - case 0x011F: ch = 0x67; break; - case 0x0120: ch = 0x47; break; - case 0x0121: ch = 0x67; break; - case 0x0122: ch = 0x47; break; - case 0x0123: ch = 0x67; break; - case 0x0124: ch = 0x48; break; - case 0x0125: ch = 0x68; break; - case 0x0126: ch = 0x48; break; - case 0x0127: ch = 0x68; break; - case 0x0128: ch = 0x49; break; - case 0x0129: ch = 0x69; break; - case 0x012A: ch = 0x49; break; - case 0x012B: ch = 0x69; break; - case 0x012C: ch = 0x49; break; - case 0x012D: ch = 0x69; break; - case 0x012E: ch = 0x49; break; - case 0x012F: ch = 0x69; break; - case 0x0130: ch = 0x49; break; - case 0x0131: ch = 0x69; break; - case 0x0134: ch = 0x4A; break; - case 0x0135: ch = 0x6A; break; - case 0x0136: ch = 0x4B; break; - case 0x0137: ch = 0x6B; break; - case 0x0139: ch = 0x4C; break; - case 0x013A: ch = 0x6C; break; - case 0x013B: ch = 0x4C; break; - case 0x013C: ch = 0x6C; break; - case 0x013D: ch = 0x4C; break; - case 0x013E: ch = 0x6C; break; - case 0x0141: ch = 0x4C; break; - case 0x0142: ch = 0x6C; break; - case 0x0143: ch = 0x4E; break; - case 0x0144: ch = 0x6E; break; - case 0x0145: ch = 0x4E; break; - case 0x0146: ch = 0x6E; break; - case 0x0147: ch = 0x4E; break; - case 0x0148: ch = 0x6E; break; - case 0x014C: ch = 0x4F; break; - case 0x014D: ch = 0x6F; break; - case 0x014E: ch = 0x4F; break; - case 0x014F: ch = 0x6F; break; - case 0x0150: ch = 0x4F; break; - case 0x0151: ch = 0x6F; break; - case 0x0152: ch = 0x4F; break; - case 0x0153: ch = 0x6F; break; - case 0x0154: ch = 0x52; break; - case 0x0155: ch = 0x72; break; - case 0x0156: ch = 0x52; break; - case 0x0157: ch = 0x72; break; - case 0x0158: ch = 0x52; break; - case 0x0159: ch = 0x72; break; - case 0x015A: ch = 0x53; break; - case 0x015B: ch = 0x73; break; - case 0x015C: ch = 0x53; break; - case 0x015D: ch = 0x73; break; - case 0x015E: ch = 0x53; break; - case 0x015F: ch = 0x73; break; - case 0x0160: ch = 0x53; break; - case 0x0161: ch = 0x73; break; - case 0x0162: ch = 0x54; break; - case 0x0163: ch = 0x74; break; - case 0x0164: ch = 0x54; break; - case 0x0165: ch = 0x74; break; - case 0x0166: ch = 0x54; break; - case 0x0167: ch = 0x74; break; - case 0x0168: ch = 0x55; break; - case 0x0169: ch = 0x75; break; - case 0x016A: ch = 0x55; break; - case 0x016B: ch = 0x75; break; - case 0x016C: ch = 0x55; break; - case 0x016D: ch = 0x75; break; - case 0x016E: ch = 0x55; break; - case 0x016F: ch = 0x75; break; - case 0x0170: ch = 0x55; break; - case 0x0171: ch = 0x75; break; - case 0x0172: ch = 0x55; break; - case 0x0173: ch = 0x75; break; - case 0x0174: ch = 0x57; break; - case 0x0175: ch = 0x77; break; - case 0x0176: ch = 0x59; break; - case 0x0177: ch = 0x79; break; - case 0x0178: ch = 0x59; break; - case 0x0179: ch = 0x5A; break; - case 0x017A: ch = 0x7A; break; - case 0x017B: ch = 0x5A; break; - case 0x017C: ch = 0x7A; break; - case 0x017D: ch = 0x5A; break; - case 0x017E: ch = 0x7A; break; - case 0x0180: ch = 0x62; break; - case 0x0189: ch = 0x44; break; - case 0x0191: ch = 0x9F; break; - case 0x0192: ch = 0x9F; break; - case 0x0197: ch = 0x49; break; - case 0x019A: ch = 0x6C; break; - case 0x019F: ch = 0x4F; break; - case 0x01A0: ch = 0x4F; break; - case 0x01A1: ch = 0x6F; break; - case 0x01A9: ch = 0xE4; break; - case 0x01AB: ch = 0x74; break; - case 0x01AE: ch = 0x54; break; - case 0x01AF: ch = 0x55; break; - case 0x01B0: ch = 0x75; break; - case 0x01B6: ch = 0x7A; break; - case 0x01C0: ch = 0x7C; break; - case 0x01C3: ch = 0x21; break; - case 0x01CD: ch = 0x41; break; - case 0x01CE: ch = 0x61; break; - case 0x01CF: ch = 0x49; break; - case 0x01D0: ch = 0x69; break; - case 0x01D1: ch = 0x4F; break; - case 0x01D2: ch = 0x6F; break; - case 0x01D3: ch = 0x55; break; - case 0x01D4: ch = 0x75; break; - case 0x01D5: ch = 0x55; break; - case 0x01D6: ch = 0x75; break; - case 0x01D7: ch = 0x55; break; - case 0x01D8: ch = 0x75; break; - case 0x01D9: ch = 0x55; break; - case 0x01DA: ch = 0x75; break; - case 0x01DB: ch = 0x55; break; - case 0x01DC: ch = 0x75; break; - case 0x01DE: ch = 0x41; break; - case 0x01DF: ch = 0x61; break; - case 0x01E4: ch = 0x47; break; - case 0x01E5: ch = 0x67; break; - case 0x01E6: ch = 0x47; break; - case 0x01E7: ch = 0x67; break; - case 0x01E8: ch = 0x4B; break; - case 0x01E9: ch = 0x6B; break; - case 0x01EA: ch = 0x4F; break; - case 0x01EB: ch = 0x6F; break; - case 0x01EC: ch = 0x4F; break; - case 0x01ED: ch = 0x6F; break; - case 0x01F0: ch = 0x6A; break; - case 0x0261: ch = 0x67; break; - case 0x0278: ch = 0xED; break; - case 0x02B9: ch = 0x27; break; - case 0x02BA: ch = 0x22; break; - case 0x02BC: ch = 0x27; break; - case 0x02C4: ch = 0x5E; break; - case 0x02C6: ch = 0x5E; break; - case 0x02C8: ch = 0x27; break; - case 0x02C9: ch = 0xC4; break; - case 0x02CA: ch = 0x27; break; - case 0x02CB: ch = 0x60; break; - case 0x02CD: ch = 0x5F; break; - case 0x02DA: ch = 0xF8; break; - case 0x02DC: ch = 0x7E; break; - case 0x0300: ch = 0x60; break; - case 0x0301: ch = 0x27; break; - case 0x0302: ch = 0x5E; break; - case 0x0303: ch = 0x7E; break; - case 0x0304: ch = 0xC4; break; - case 0x0308: ch = 0x22; break; - case 0x030A: ch = 0xF8; break; - case 0x030E: ch = 0x22; break; - case 0x0327: ch = 0x2C; break; - case 0x0331: ch = 0x5F; break; - case 0x0332: ch = 0x5F; break; - case 0x037E: ch = 0x3B; break; - case 0x0391: ch = 0xE0; break; - case 0x0393: ch = 0xE2; break; - case 0x0394: ch = 0xEB; break; - case 0x0395: ch = 0xEE; break; - case 0x0398: ch = 0xE9; break; - case 0x03A0: ch = 0xE3; break; - case 0x03A3: ch = 0xE4; break; - case 0x03A4: ch = 0xE7; break; - case 0x03A6: ch = 0xE8; break; - case 0x03A9: ch = 0xEA; break; - case 0x03B1: ch = 0xE0; break; - case 0x03B2: ch = 0xE1; break; - case 0x03B4: ch = 0xEB; break; - case 0x03B5: ch = 0xEE; break; - case 0x03BC: ch = 0xE6; break; - case 0x03C0: ch = 0xE3; break; - case 0x03C3: ch = 0xE5; break; - case 0x03C4: ch = 0xE7; break; - case 0x03C6: ch = 0xED; break; - case 0x04BB: ch = 0x68; break; - case 0x0589: ch = 0x3A; break; - case 0x066A: ch = 0x25; break; - case 0x2000: ch = 0x20; break; - case 0x2001: ch = 0x20; break; - case 0x2002: ch = 0x20; break; - case 0x2003: ch = 0x20; break; - case 0x2004: ch = 0x20; break; - case 0x2005: ch = 0x20; break; - case 0x2006: ch = 0x20; break; - case 0x2010: ch = 0x2D; break; - case 0x2011: ch = 0x2D; break; - case 0x2013: ch = 0x2D; break; - case 0x2014: ch = 0x2D; break; - case 0x2017: ch = 0x5F; break; - case 0x2018: ch = 0x60; break; - case 0x2019: ch = 0x27; break; - case 0x201A: ch = 0x2C; break; - case 0x201C: ch = 0x22; break; - case 0x201D: ch = 0x22; break; - case 0x201E: ch = 0x2C; break; - case 0x2020: ch = 0x2B; break; - case 0x2021: ch = 0xD8; break; - case 0x2022: ch = 0x07; break; - case 0x2024: ch = 0xFA; break; - case 0x2026: ch = 0x2E; break; - case 0x2030: ch = 0x25; break; - case 0x2032: ch = 0x27; break; - case 0x2035: ch = 0x60; break; - case 0x2039: ch = 0x3C; break; - case 0x203A: ch = 0x3E; break; - case 0x203C: ch = 0x13; break; - case 0x2044: ch = 0x2F; break; - case 0x2070: ch = 0xF8; break; - case 0x2074: - case 0x2075: - case 0x2076: - case 0x2077: - case 0x2078: - ch -= 0x2040; - break; - case 0x207F: ch = 0xFC; break; - case 0x2080: - case 0x2081: - case 0x2082: - case 0x2083: - case 0x2084: - case 0x2085: - case 0x2086: - case 0x2087: - case 0x2088: - case 0x2089: - ch -= 0x2050; - break; - case 0x20A4: ch = 0x9C; break; - case 0x20A7: ch = 0x9E; break; - case 0x20DD: ch = 0x09; break; - case 0x2102: ch = 0x43; break; - case 0x2107: ch = 0x45; break; - case 0x210A: ch = 0x67; break; - case 0x210B: ch = 0x48; break; - case 0x210C: ch = 0x48; break; - case 0x210D: ch = 0x48; break; - case 0x210E: ch = 0x68; break; - case 0x2110: ch = 0x49; break; - case 0x2111: ch = 0x49; break; - case 0x2112: ch = 0x4C; break; - case 0x2113: ch = 0x6C; break; - case 0x2115: ch = 0x4E; break; - case 0x2118: ch = 0x50; break; - case 0x2119: ch = 0x50; break; - case 0x211A: ch = 0x51; break; - case 0x211B: ch = 0x52; break; - case 0x211C: ch = 0x52; break; - case 0x211D: ch = 0x52; break; - case 0x2122: ch = 0x54; break; - case 0x2124: ch = 0x5A; break; - case 0x2126: ch = 0xEA; break; - case 0x2128: ch = 0x5A; break; - case 0x212A: ch = 0x4B; break; - case 0x212B: ch = 0x8F; break; - case 0x212C: ch = 0x42; break; - case 0x212D: ch = 0x43; break; - case 0x212E: ch = 0x65; break; - case 0x212F: ch = 0x65; break; - case 0x2130: ch = 0x45; break; - case 0x2131: ch = 0x46; break; - case 0x2133: ch = 0x4D; break; - case 0x2134: ch = 0x6F; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x2205: ch = 0xED; break; - case 0x2211: ch = 0xE4; break; - case 0x2212: ch = 0x2D; break; - case 0x2213: ch = 0xF1; break; - case 0x2215: ch = 0x2F; break; - case 0x2216: ch = 0x5C; break; - case 0x2217: ch = 0x2A; break; - case 0x2218: ch = 0xF8; break; - case 0x2219: ch = 0xF9; break; - case 0x221A: ch = 0xFB; break; - case 0x221E: ch = 0xEC; break; - case 0x221F: ch = 0x1C; break; - case 0x2223: ch = 0x7C; break; - case 0x2229: ch = 0xEF; break; - case 0x2236: ch = 0x3A; break; - case 0x223C: ch = 0x7E; break; - case 0x2248: ch = 0xF7; break; - case 0x2261: ch = 0xF0; break; - case 0x2264: ch = 0xF3; break; - case 0x2265: ch = 0xF2; break; - case 0x226A: ch = 0xAE; break; - case 0x226B: ch = 0xAF; break; - case 0x22C5: ch = 0xFA; break; - case 0x2302: ch = 0x7F; break; - case 0x2303: ch = 0x5E; break; - case 0x2310: ch = 0xA9; break; - case 0x2320: ch = 0xF4; break; - case 0x2321: ch = 0xF5; break; - case 0x2329: ch = 0x3C; break; - case 0x232A: ch = 0x3E; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2552: ch = 0xD5; break; - case 0x2553: ch = 0xD6; break; - case 0x2554: ch = 0xC9; break; - case 0x2555: ch = 0xB8; break; - case 0x2556: ch = 0xB7; break; - case 0x2557: ch = 0xBB; break; - case 0x2558: ch = 0xD4; break; - case 0x2559: ch = 0xD3; break; - case 0x255A: ch = 0xC8; break; - case 0x255B: ch = 0xBE; break; - case 0x255C: ch = 0xBD; break; - case 0x255D: ch = 0xBC; break; - case 0x255E: ch = 0xC6; break; - case 0x255F: ch = 0xC7; break; - case 0x2560: ch = 0xCC; break; - case 0x2561: ch = 0xB5; break; - case 0x2562: ch = 0xB6; break; - case 0x2563: ch = 0xB9; break; - case 0x2564: ch = 0xD1; break; - case 0x2565: ch = 0xD2; break; - case 0x2566: ch = 0xCB; break; - case 0x2567: ch = 0xCF; break; - case 0x2568: ch = 0xD0; break; - case 0x2569: ch = 0xCA; break; - case 0x256A: ch = 0xD8; break; - case 0x256B: ch = 0xD7; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x258C: ch = 0xDD; break; - case 0x2590: ch = 0xDE; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0x2713: ch = 0xFB; break; - case 0x2758: ch = 0x7C; break; - case 0x3000: ch = 0x20; break; - case 0x3007: ch = 0x09; break; - case 0x3008: ch = 0x3C; break; - case 0x3009: ch = 0x3E; break; - case 0x300A: ch = 0xAE; break; - case 0x300B: ch = 0xAF; break; - case 0x301A: ch = 0x5B; break; - case 0x301B: ch = 0x5D; break; - case 0x30FB: ch = 0xFA; break; - case 0xFF01: - case 0xFF02: - case 0xFF03: - case 0xFF04: - case 0xFF05: - case 0xFF06: - case 0xFF07: - case 0xFF08: - case 0xFF09: - case 0xFF0A: - case 0xFF0B: - case 0xFF0C: - case 0xFF0D: - case 0xFF0E: - case 0xFF0F: - case 0xFF10: - case 0xFF11: - case 0xFF12: - case 0xFF13: - case 0xFF14: - case 0xFF15: - case 0xFF16: - case 0xFF17: - case 0xFF18: - case 0xFF19: - case 0xFF1A: - case 0xFF1B: - case 0xFF1C: - case 0xFF1D: - case 0xFF1E: - ch -= 0xFEE0; - break; - case 0xFF20: - case 0xFF21: - case 0xFF22: - case 0xFF23: - case 0xFF24: - case 0xFF25: - case 0xFF26: - case 0xFF27: - case 0xFF28: - case 0xFF29: - case 0xFF2A: - case 0xFF2B: - case 0xFF2C: - case 0xFF2D: - case 0xFF2E: - case 0xFF2F: - case 0xFF30: - case 0xFF31: - case 0xFF32: - case 0xFF33: - case 0xFF34: - case 0xFF35: - case 0xFF36: - case 0xFF37: - case 0xFF38: - case 0xFF39: - case 0xFF3A: - case 0xFF3B: - case 0xFF3C: - case 0xFF3D: - case 0xFF3E: - case 0xFF3F: - case 0xFF40: - case 0xFF41: - case 0xFF42: - case 0xFF43: - case 0xFF44: - case 0xFF45: - case 0xFF46: - case 0xFF47: - case 0xFF48: - case 0xFF49: - case 0xFF4A: - case 0xFF4B: - case 0xFF4C: - case 0xFF4D: - case 0xFF4E: - case 0xFF4F: - case 0xFF50: - case 0xFF51: - case 0xFF52: - case 0xFF53: - case 0xFF54: - case 0xFF55: - case 0xFF56: - case 0xFF57: - case 0xFF58: - case 0xFF59: - case 0xFF5A: - case 0xFF5B: - case 0xFF5C: - case 0xFF5D: - case 0xFF5E: - ch -= 0xFEE0; - break; - default: ch = 0x3F; break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP437 [Serializable] diff --git a/mcs/class/I18N/West/CP850.cs b/mcs/class/I18N/West/CP850.cs index 0ae6ddfdfe2..76b4a8b30b1 100644 --- a/mcs/class/I18N/West/CP850.cs +++ b/mcs/class/I18N/West/CP850.cs @@ -97,12 +97,11 @@ public class CP850 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP850 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP850 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -442,306 +441,6 @@ public class CP850 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A1: ch = 0xAD; break; - case 0x00A2: ch = 0xBD; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A4: ch = 0xCF; break; - case 0x00A5: ch = 0xBE; break; - case 0x00A6: ch = 0xDD; break; - case 0x00A7: ch = 0xF5; break; - case 0x00A8: ch = 0xF9; break; - case 0x00A9: ch = 0xB8; break; - case 0x00AA: ch = 0xA6; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0xAA; break; - case 0x00AD: ch = 0xF0; break; - case 0x00AE: ch = 0xA9; break; - case 0x00AF: ch = 0xEE; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0xFD; break; - case 0x00B3: ch = 0xFC; break; - case 0x00B4: ch = 0xEF; break; - case 0x00B5: ch = 0xE6; break; - case 0x00B6: ch = 0xF4; break; - case 0x00B7: ch = 0xFA; break; - case 0x00B8: ch = 0xF7; break; - case 0x00B9: ch = 0xFB; break; - case 0x00BA: ch = 0xA7; break; - case 0x00BB: ch = 0xAF; break; - case 0x00BC: ch = 0xAC; break; - case 0x00BD: ch = 0xAB; break; - case 0x00BE: ch = 0xF3; break; - case 0x00BF: ch = 0xA8; break; - case 0x00C0: ch = 0xB7; break; - case 0x00C1: ch = 0xB5; break; - case 0x00C2: ch = 0xB6; break; - case 0x00C3: ch = 0xC7; break; - case 0x00C4: ch = 0x8E; break; - case 0x00C5: ch = 0x8F; break; - case 0x00C6: ch = 0x92; break; - case 0x00C7: ch = 0x80; break; - case 0x00C8: ch = 0xD4; break; - case 0x00C9: ch = 0x90; break; - case 0x00CA: ch = 0xD2; break; - case 0x00CB: ch = 0xD3; break; - case 0x00CC: ch = 0xDE; break; - case 0x00CD: ch = 0xD6; break; - case 0x00CE: ch = 0xD7; break; - case 0x00CF: ch = 0xD8; break; - case 0x00D0: ch = 0xD1; break; - case 0x00D1: ch = 0xA5; break; - case 0x00D2: ch = 0xE3; break; - case 0x00D3: ch = 0xE0; break; - case 0x00D4: ch = 0xE2; break; - case 0x00D5: ch = 0xE5; break; - case 0x00D6: ch = 0x99; break; - case 0x00D7: ch = 0x9E; break; - case 0x00D8: ch = 0x9D; break; - case 0x00D9: ch = 0xEB; break; - case 0x00DA: ch = 0xE9; break; - case 0x00DB: ch = 0xEA; break; - case 0x00DC: ch = 0x9A; break; - case 0x00DD: ch = 0xED; break; - case 0x00DE: ch = 0xE8; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E0: ch = 0x85; break; - case 0x00E1: ch = 0xA0; break; - case 0x00E2: ch = 0x83; break; - case 0x00E3: ch = 0xC6; break; - case 0x00E4: ch = 0x84; break; - case 0x00E5: ch = 0x86; break; - case 0x00E6: ch = 0x91; break; - case 0x00E7: ch = 0x87; break; - case 0x00E8: ch = 0x8A; break; - case 0x00E9: ch = 0x82; break; - case 0x00EA: ch = 0x88; break; - case 0x00EB: ch = 0x89; break; - case 0x00EC: ch = 0x8D; break; - case 0x00ED: ch = 0xA1; break; - case 0x00EE: ch = 0x8C; break; - case 0x00EF: ch = 0x8B; break; - case 0x00F0: ch = 0xD0; break; - case 0x00F1: ch = 0xA4; break; - case 0x00F2: ch = 0x95; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F4: ch = 0x93; break; - case 0x00F5: ch = 0xE4; break; - case 0x00F6: ch = 0x94; break; - case 0x00F7: ch = 0xF6; break; - case 0x00F8: ch = 0x9B; break; - case 0x00F9: ch = 0x97; break; - case 0x00FA: ch = 0xA3; break; - case 0x00FB: ch = 0x96; break; - case 0x00FC: ch = 0x81; break; - case 0x00FD: ch = 0xEC; break; - case 0x00FE: ch = 0xE7; break; - case 0x00FF: ch = 0x98; break; - case 0x0110: ch = 0xD1; break; - case 0x0131: ch = 0xD5; break; - case 0x0192: ch = 0x9F; break; - case 0x2017: ch = 0xF2; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x203E: ch = 0xEE; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x221F: ch = 0x1C; break; - case 0x2302: ch = 0x7F; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2554: ch = 0xC9; break; - case 0x2557: ch = 0xBB; break; - case 0x255A: ch = 0xC8; break; - case 0x255D: ch = 0xBC; break; - case 0x2560: ch = 0xCC; break; - case 0x2563: ch = 0xB9; break; - case 0x2566: ch = 0xCB; break; - case 0x2569: ch = 0xCA; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266C: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP850 [Serializable] diff --git a/mcs/class/I18N/West/CP860.cs b/mcs/class/I18N/West/CP860.cs index ec78e825a2a..8c43f28d57a 100644 --- a/mcs/class/I18N/West/CP860.cs +++ b/mcs/class/I18N/West/CP860.cs @@ -97,12 +97,11 @@ public class CP860 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP860 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP860 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -442,306 +441,6 @@ public class CP860 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A1: ch = 0xAD; break; - case 0x00A2: ch = 0x9B; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A7: ch = 0x15; break; - case 0x00AA: ch = 0xA6; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0xAA; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0xFD; break; - case 0x00B6: ch = 0x14; break; - case 0x00B7: ch = 0xFA; break; - case 0x00BA: ch = 0xA7; break; - case 0x00BB: ch = 0xAF; break; - case 0x00BC: ch = 0xAC; break; - case 0x00BD: ch = 0xAB; break; - case 0x00BF: ch = 0xA8; break; - case 0x00C0: ch = 0x91; break; - case 0x00C1: ch = 0x86; break; - case 0x00C2: ch = 0x8F; break; - case 0x00C3: ch = 0x8E; break; - case 0x00C7: ch = 0x80; break; - case 0x00C8: ch = 0x92; break; - case 0x00C9: ch = 0x90; break; - case 0x00CA: ch = 0x89; break; - case 0x00CC: ch = 0x98; break; - case 0x00CD: ch = 0x8B; break; - case 0x00D1: ch = 0xA5; break; - case 0x00D2: ch = 0xA9; break; - case 0x00D3: ch = 0x9F; break; - case 0x00D4: ch = 0x8C; break; - case 0x00D5: ch = 0x99; break; - case 0x00D9: ch = 0x9D; break; - case 0x00DA: ch = 0x96; break; - case 0x00DC: ch = 0x9A; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E0: ch = 0x85; break; - case 0x00E1: ch = 0xA0; break; - case 0x00E2: ch = 0x83; break; - case 0x00E3: ch = 0x84; break; - case 0x00E7: ch = 0x87; break; - case 0x00E8: ch = 0x8A; break; - case 0x00E9: ch = 0x82; break; - case 0x00EA: ch = 0x88; break; - case 0x00EC: ch = 0x8D; break; - case 0x00ED: ch = 0xA1; break; - case 0x00F1: ch = 0xA4; break; - case 0x00F2: ch = 0x95; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F4: ch = 0x93; break; - case 0x00F5: ch = 0x94; break; - case 0x00F7: ch = 0xF6; break; - case 0x00F9: ch = 0x97; break; - case 0x00FA: ch = 0xA3; break; - case 0x00FC: ch = 0x81; break; - case 0x0393: ch = 0xE2; break; - case 0x0398: ch = 0xE9; break; - case 0x03A3: ch = 0xE4; break; - case 0x03A6: ch = 0xE8; break; - case 0x03A9: ch = 0xEA; break; - case 0x03B1: ch = 0xE0; break; - case 0x03B4: ch = 0xEB; break; - case 0x03B5: ch = 0xEE; break; - case 0x03BC: ch = 0xE6; break; - case 0x03C0: ch = 0xE3; break; - case 0x03C3: ch = 0xE5; break; - case 0x03C4: ch = 0xE7; break; - case 0x03C6: ch = 0xED; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x207F: ch = 0xFC; break; - case 0x20A7: ch = 0x9E; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x2219: ch = 0xF9; break; - case 0x221A: ch = 0xFB; break; - case 0x221E: ch = 0xEC; break; - case 0x221F: ch = 0x1C; break; - case 0x2229: ch = 0xEF; break; - case 0x2248: ch = 0xF7; break; - case 0x2261: ch = 0xF0; break; - case 0x2264: ch = 0xF3; break; - case 0x2265: ch = 0xF2; break; - case 0x2302: ch = 0x7F; break; - case 0x2320: ch = 0xF4; break; - case 0x2321: ch = 0xF5; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2552: ch = 0xD5; break; - case 0x2553: ch = 0xD6; break; - case 0x2554: ch = 0xC9; break; - case 0x2555: ch = 0xB8; break; - case 0x2556: ch = 0xB7; break; - case 0x2557: ch = 0xBB; break; - case 0x2558: ch = 0xD4; break; - case 0x2559: ch = 0xD3; break; - case 0x255A: ch = 0xC8; break; - case 0x255B: ch = 0xBE; break; - case 0x255C: ch = 0xBD; break; - case 0x255D: ch = 0xBC; break; - case 0x255E: ch = 0xC6; break; - case 0x255F: ch = 0xC7; break; - case 0x2560: ch = 0xCC; break; - case 0x2561: ch = 0xB5; break; - case 0x2562: ch = 0xB6; break; - case 0x2563: ch = 0xB9; break; - case 0x2564: ch = 0xD1; break; - case 0x2565: ch = 0xD2; break; - case 0x2566: ch = 0xCB; break; - case 0x2567: ch = 0xCF; break; - case 0x2568: ch = 0xD0; break; - case 0x2569: ch = 0xCA; break; - case 0x256A: ch = 0xD8; break; - case 0x256B: ch = 0xD7; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x258C: ch = 0xDD; break; - case 0x2590: ch = 0xDE; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP860 [Serializable] diff --git a/mcs/class/I18N/West/CP861.cs b/mcs/class/I18N/West/CP861.cs index 0737e1a705e..045cef37374 100644 --- a/mcs/class/I18N/West/CP861.cs +++ b/mcs/class/I18N/West/CP861.cs @@ -97,12 +97,11 @@ public class CP861 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP861 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP861 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -442,306 +441,6 @@ public class CP861 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A1: ch = 0xAD; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A7: ch = 0x15; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0xAA; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0xFD; break; - case 0x00B6: ch = 0x14; break; - case 0x00B7: ch = 0xFA; break; - case 0x00BB: ch = 0xAF; break; - case 0x00BC: ch = 0xAC; break; - case 0x00BD: ch = 0xAB; break; - case 0x00BF: ch = 0xA8; break; - case 0x00C1: ch = 0xA4; break; - case 0x00C4: ch = 0x8E; break; - case 0x00C5: ch = 0x8F; break; - case 0x00C6: ch = 0x92; break; - case 0x00C7: ch = 0x80; break; - case 0x00C9: ch = 0x90; break; - case 0x00CD: ch = 0xA5; break; - case 0x00D0: ch = 0x8B; break; - case 0x00D3: ch = 0xA6; break; - case 0x00D6: ch = 0x99; break; - case 0x00D8: ch = 0x9D; break; - case 0x00DA: ch = 0xA7; break; - case 0x00DC: ch = 0x9A; break; - case 0x00DD: ch = 0x97; break; - case 0x00DE: ch = 0x8D; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E0: ch = 0x85; break; - case 0x00E1: ch = 0xA0; break; - case 0x00E2: ch = 0x83; break; - case 0x00E4: ch = 0x84; break; - case 0x00E5: ch = 0x86; break; - case 0x00E6: ch = 0x91; break; - case 0x00E7: ch = 0x87; break; - case 0x00E8: ch = 0x8A; break; - case 0x00E9: ch = 0x82; break; - case 0x00EA: ch = 0x88; break; - case 0x00EB: ch = 0x89; break; - case 0x00ED: ch = 0xA1; break; - case 0x00F0: ch = 0x8C; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F4: ch = 0x93; break; - case 0x00F6: ch = 0x94; break; - case 0x00F7: ch = 0xF6; break; - case 0x00F8: ch = 0x9B; break; - case 0x00FA: ch = 0xA3; break; - case 0x00FB: ch = 0x96; break; - case 0x00FC: ch = 0x81; break; - case 0x00FD: ch = 0x98; break; - case 0x00FE: ch = 0x95; break; - case 0x0192: ch = 0x9F; break; - case 0x0393: ch = 0xE2; break; - case 0x0398: ch = 0xE9; break; - case 0x03A3: ch = 0xE4; break; - case 0x03A6: ch = 0xE8; break; - case 0x03A9: ch = 0xEA; break; - case 0x03B1: ch = 0xE0; break; - case 0x03B4: ch = 0xEB; break; - case 0x03B5: ch = 0xEE; break; - case 0x03BC: ch = 0xE6; break; - case 0x03C0: ch = 0xE3; break; - case 0x03C3: ch = 0xE5; break; - case 0x03C4: ch = 0xE7; break; - case 0x03C6: ch = 0xED; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x207F: ch = 0xFC; break; - case 0x20A7: ch = 0x9E; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x2219: ch = 0xF9; break; - case 0x221A: ch = 0xFB; break; - case 0x221E: ch = 0xEC; break; - case 0x221F: ch = 0x1C; break; - case 0x2229: ch = 0xEF; break; - case 0x2248: ch = 0xF7; break; - case 0x2261: ch = 0xF0; break; - case 0x2264: ch = 0xF3; break; - case 0x2265: ch = 0xF2; break; - case 0x2302: ch = 0x7F; break; - case 0x2310: ch = 0xA9; break; - case 0x2320: ch = 0xF4; break; - case 0x2321: ch = 0xF5; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2552: ch = 0xD5; break; - case 0x2553: ch = 0xD6; break; - case 0x2554: ch = 0xC9; break; - case 0x2555: ch = 0xB8; break; - case 0x2556: ch = 0xB7; break; - case 0x2557: ch = 0xBB; break; - case 0x2558: ch = 0xD4; break; - case 0x2559: ch = 0xD3; break; - case 0x255A: ch = 0xC8; break; - case 0x255B: ch = 0xBE; break; - case 0x255C: ch = 0xBD; break; - case 0x255D: ch = 0xBC; break; - case 0x255E: ch = 0xC6; break; - case 0x255F: ch = 0xC7; break; - case 0x2560: ch = 0xCC; break; - case 0x2561: ch = 0xB5; break; - case 0x2562: ch = 0xB6; break; - case 0x2563: ch = 0xB9; break; - case 0x2564: ch = 0xD1; break; - case 0x2565: ch = 0xD2; break; - case 0x2566: ch = 0xCB; break; - case 0x2567: ch = 0xCF; break; - case 0x2568: ch = 0xD0; break; - case 0x2569: ch = 0xCA; break; - case 0x256A: ch = 0xD8; break; - case 0x256B: ch = 0xD7; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x258C: ch = 0xDD; break; - case 0x2590: ch = 0xDE; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP861 [Serializable] diff --git a/mcs/class/I18N/West/CP863.cs b/mcs/class/I18N/West/CP863.cs index 46213d44895..7d7e43878f0 100644 --- a/mcs/class/I18N/West/CP863.cs +++ b/mcs/class/I18N/West/CP863.cs @@ -97,12 +97,11 @@ public class CP863 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP863 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP863 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -441,305 +440,6 @@ public class CP863 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A2: ch = 0x9B; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A4: ch = 0x98; break; - case 0x00A6: ch = 0xA0; break; - case 0x00A7: ch = 0x8F; break; - case 0x00A8: ch = 0xA4; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0xAA; break; - case 0x00AF: ch = 0xA7; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0xFD; break; - case 0x00B3: ch = 0xA6; break; - case 0x00B4: ch = 0xA1; break; - case 0x00B6: ch = 0x86; break; - case 0x00B7: ch = 0xFA; break; - case 0x00B8: ch = 0xA5; break; - case 0x00BB: ch = 0xAF; break; - case 0x00BC: ch = 0xAC; break; - case 0x00BD: ch = 0xAB; break; - case 0x00BE: ch = 0xAD; break; - case 0x00C0: ch = 0x8E; break; - case 0x00C2: ch = 0x84; break; - case 0x00C7: ch = 0x80; break; - case 0x00C8: ch = 0x91; break; - case 0x00C9: ch = 0x90; break; - case 0x00CA: ch = 0x92; break; - case 0x00CB: ch = 0x94; break; - case 0x00CE: ch = 0xA8; break; - case 0x00CF: ch = 0x95; break; - case 0x00D4: ch = 0x99; break; - case 0x00D9: ch = 0x9D; break; - case 0x00DB: ch = 0x9E; break; - case 0x00DC: ch = 0x9A; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E0: ch = 0x85; break; - case 0x00E2: ch = 0x83; break; - case 0x00E7: ch = 0x87; break; - case 0x00E8: ch = 0x8A; break; - case 0x00E9: ch = 0x82; break; - case 0x00EA: ch = 0x88; break; - case 0x00EB: ch = 0x89; break; - case 0x00EE: ch = 0x8C; break; - case 0x00EF: ch = 0x8B; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F4: ch = 0x93; break; - case 0x00F7: ch = 0xF6; break; - case 0x00F9: ch = 0x97; break; - case 0x00FA: ch = 0xA3; break; - case 0x00FB: ch = 0x96; break; - case 0x00FC: ch = 0x81; break; - case 0x0192: ch = 0x9F; break; - case 0x0393: ch = 0xE2; break; - case 0x0398: ch = 0xE9; break; - case 0x03A3: ch = 0xE4; break; - case 0x03A6: ch = 0xE8; break; - case 0x03A9: ch = 0xEA; break; - case 0x03B1: ch = 0xE0; break; - case 0x03B4: ch = 0xEB; break; - case 0x03B5: ch = 0xEE; break; - case 0x03BC: ch = 0xE6; break; - case 0x03C0: ch = 0xE3; break; - case 0x03C3: ch = 0xE5; break; - case 0x03C4: ch = 0xE7; break; - case 0x03C6: ch = 0xED; break; - case 0x2017: ch = 0x8D; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x203E: ch = 0xA7; break; - case 0x207F: ch = 0xFC; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x2219: ch = 0xF9; break; - case 0x221A: ch = 0xFB; break; - case 0x221E: ch = 0xEC; break; - case 0x221F: ch = 0x1C; break; - case 0x2229: ch = 0xEF; break; - case 0x2248: ch = 0xF7; break; - case 0x2261: ch = 0xF0; break; - case 0x2264: ch = 0xF3; break; - case 0x2265: ch = 0xF2; break; - case 0x2302: ch = 0x7F; break; - case 0x2310: ch = 0xA9; break; - case 0x2320: ch = 0xF4; break; - case 0x2321: ch = 0xF5; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2552: ch = 0xD5; break; - case 0x2553: ch = 0xD6; break; - case 0x2554: ch = 0xC9; break; - case 0x2555: ch = 0xB8; break; - case 0x2556: ch = 0xB7; break; - case 0x2557: ch = 0xBB; break; - case 0x2558: ch = 0xD4; break; - case 0x2559: ch = 0xD3; break; - case 0x255A: ch = 0xC8; break; - case 0x255B: ch = 0xBE; break; - case 0x255C: ch = 0xBD; break; - case 0x255D: ch = 0xBC; break; - case 0x255E: ch = 0xC6; break; - case 0x255F: ch = 0xC7; break; - case 0x2560: ch = 0xCC; break; - case 0x2561: ch = 0xB5; break; - case 0x2562: ch = 0xB6; break; - case 0x2563: ch = 0xB9; break; - case 0x2564: ch = 0xD1; break; - case 0x2565: ch = 0xD2; break; - case 0x2566: ch = 0xCB; break; - case 0x2567: ch = 0xCF; break; - case 0x2568: ch = 0xD0; break; - case 0x2569: ch = 0xCA; break; - case 0x256A: ch = 0xD8; break; - case 0x256B: ch = 0xD7; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x258C: ch = 0xDD; break; - case 0x2590: ch = 0xDE; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP863 [Serializable] diff --git a/mcs/class/I18N/West/CP865.cs b/mcs/class/I18N/West/CP865.cs index 2d228f3e551..6ebaa268531 100644 --- a/mcs/class/I18N/West/CP865.cs +++ b/mcs/class/I18N/West/CP865.cs @@ -97,12 +97,11 @@ public class CP865 : ByteEncoding return GetBytesImpl(chars, count, null, 0); } else - { return count; } } - + // Get the number of bytes needed to encode a character buffer. public override int GetByteCount (String s) { @@ -123,7 +122,7 @@ public class CP865 : ByteEncoding return s.Length; } } - + //ToBytes is just an alias for GetBytesImpl, but doesn't return byte count protected unsafe override void ToBytes(char* chars, int charCount, byte* bytes, int byteCount) @@ -133,7 +132,7 @@ public class CP865 : ByteEncoding throw new ArgumentNullException("bytes"); GetBytesImpl(chars, charCount, bytes, byteCount); } - + public unsafe override int GetBytesImpl (char* chars, int charCount, byte* bytes, int byteCount) { @@ -442,306 +441,6 @@ public class CP865 : ByteEncoding } return byteIndex; } - - /* - protected override void ToBytes(String s, int charIndex, int charCount, - byte[] bytes, int byteIndex) - { - int ch; - while(charCount > 0) - { - ch = (int)(s[charIndex++]); - if(ch >= 26) switch(ch) - { - case 0x001B: - case 0x001D: - case 0x001E: - case 0x001F: - case 0x0020: - case 0x0021: - case 0x0022: - case 0x0023: - case 0x0024: - case 0x0025: - case 0x0026: - case 0x0027: - case 0x0028: - case 0x0029: - case 0x002A: - case 0x002B: - case 0x002C: - case 0x002D: - case 0x002E: - case 0x002F: - case 0x0030: - case 0x0031: - case 0x0032: - case 0x0033: - case 0x0034: - case 0x0035: - case 0x0036: - case 0x0037: - case 0x0038: - case 0x0039: - case 0x003A: - case 0x003B: - case 0x003C: - case 0x003D: - case 0x003E: - case 0x003F: - case 0x0040: - case 0x0041: - case 0x0042: - case 0x0043: - case 0x0044: - case 0x0045: - case 0x0046: - case 0x0047: - case 0x0048: - case 0x0049: - case 0x004A: - case 0x004B: - case 0x004C: - case 0x004D: - case 0x004E: - case 0x004F: - case 0x0050: - case 0x0051: - case 0x0052: - case 0x0053: - case 0x0054: - case 0x0055: - case 0x0056: - case 0x0057: - case 0x0058: - case 0x0059: - case 0x005A: - case 0x005B: - case 0x005C: - case 0x005D: - case 0x005E: - case 0x005F: - case 0x0060: - case 0x0061: - case 0x0062: - case 0x0063: - case 0x0064: - case 0x0065: - case 0x0066: - case 0x0067: - case 0x0068: - case 0x0069: - case 0x006A: - case 0x006B: - case 0x006C: - case 0x006D: - case 0x006E: - case 0x006F: - case 0x0070: - case 0x0071: - case 0x0072: - case 0x0073: - case 0x0074: - case 0x0075: - case 0x0076: - case 0x0077: - case 0x0078: - case 0x0079: - case 0x007A: - case 0x007B: - case 0x007C: - case 0x007D: - case 0x007E: - break; - case 0x001A: ch = 0x7F; break; - case 0x001C: ch = 0x1A; break; - case 0x007F: ch = 0x1C; break; - case 0x00A0: ch = 0xFF; break; - case 0x00A1: ch = 0xAD; break; - case 0x00A3: ch = 0x9C; break; - case 0x00A4: ch = 0xAF; break; - case 0x00A7: ch = 0x15; break; - case 0x00AA: ch = 0xA6; break; - case 0x00AB: ch = 0xAE; break; - case 0x00AC: ch = 0xAA; break; - case 0x00B0: ch = 0xF8; break; - case 0x00B1: ch = 0xF1; break; - case 0x00B2: ch = 0xFD; break; - case 0x00B6: ch = 0x14; break; - case 0x00B7: ch = 0xFA; break; - case 0x00BA: ch = 0xA7; break; - case 0x00BC: ch = 0xAC; break; - case 0x00BD: ch = 0xAB; break; - case 0x00BF: ch = 0xA8; break; - case 0x00C4: ch = 0x8E; break; - case 0x00C5: ch = 0x8F; break; - case 0x00C6: ch = 0x92; break; - case 0x00C7: ch = 0x80; break; - case 0x00C9: ch = 0x90; break; - case 0x00D1: ch = 0xA5; break; - case 0x00D6: ch = 0x99; break; - case 0x00D8: ch = 0x9D; break; - case 0x00DC: ch = 0x9A; break; - case 0x00DF: ch = 0xE1; break; - case 0x00E0: ch = 0x85; break; - case 0x00E1: ch = 0xA0; break; - case 0x00E2: ch = 0x83; break; - case 0x00E4: ch = 0x84; break; - case 0x00E5: ch = 0x86; break; - case 0x00E6: ch = 0x91; break; - case 0x00E7: ch = 0x87; break; - case 0x00E8: ch = 0x8A; break; - case 0x00E9: ch = 0x82; break; - case 0x00EA: ch = 0x88; break; - case 0x00EB: ch = 0x89; break; - case 0x00EC: ch = 0x8D; break; - case 0x00ED: ch = 0xA1; break; - case 0x00EE: ch = 0x8C; break; - case 0x00EF: ch = 0x8B; break; - case 0x00F1: ch = 0xA4; break; - case 0x00F2: ch = 0x95; break; - case 0x00F3: ch = 0xA2; break; - case 0x00F4: ch = 0x93; break; - case 0x00F6: ch = 0x94; break; - case 0x00F7: ch = 0xF6; break; - case 0x00F8: ch = 0x9B; break; - case 0x00F9: ch = 0x97; break; - case 0x00FA: ch = 0xA3; break; - case 0x00FB: ch = 0x96; break; - case 0x00FC: ch = 0x81; break; - case 0x00FF: ch = 0x98; break; - case 0x0192: ch = 0x9F; break; - case 0x0393: ch = 0xE2; break; - case 0x0398: ch = 0xE9; break; - case 0x03A3: ch = 0xE4; break; - case 0x03A6: ch = 0xE8; break; - case 0x03A9: ch = 0xEA; break; - case 0x03B1: ch = 0xE0; break; - case 0x03B4: ch = 0xEB; break; - case 0x03B5: ch = 0xEE; break; - case 0x03BC: ch = 0xE6; break; - case 0x03C0: ch = 0xE3; break; - case 0x03C3: ch = 0xE5; break; - case 0x03C4: ch = 0xE7; break; - case 0x03C6: ch = 0xED; break; - case 0x2022: ch = 0x07; break; - case 0x203C: ch = 0x13; break; - case 0x207F: ch = 0xFC; break; - case 0x20A7: ch = 0x9E; break; - case 0x2190: ch = 0x1B; break; - case 0x2191: ch = 0x18; break; - case 0x2192: ch = 0x1A; break; - case 0x2193: ch = 0x19; break; - case 0x2194: ch = 0x1D; break; - case 0x2195: ch = 0x12; break; - case 0x21A8: ch = 0x17; break; - case 0x2219: ch = 0xF9; break; - case 0x221A: ch = 0xFB; break; - case 0x221E: ch = 0xEC; break; - case 0x221F: ch = 0x1C; break; - case 0x2229: ch = 0xEF; break; - case 0x2248: ch = 0xF7; break; - case 0x2261: ch = 0xF0; break; - case 0x2264: ch = 0xF3; break; - case 0x2265: ch = 0xF2; break; - case 0x2302: ch = 0x7F; break; - case 0x2310: ch = 0xA9; break; - case 0x2320: ch = 0xF4; break; - case 0x2321: ch = 0xF5; break; - case 0x2500: ch = 0xC4; break; - case 0x2502: ch = 0xB3; break; - case 0x250C: ch = 0xDA; break; - case 0x2510: ch = 0xBF; break; - case 0x2514: ch = 0xC0; break; - case 0x2518: ch = 0xD9; break; - case 0x251C: ch = 0xC3; break; - case 0x2524: ch = 0xB4; break; - case 0x252C: ch = 0xC2; break; - case 0x2534: ch = 0xC1; break; - case 0x253C: ch = 0xC5; break; - case 0x2550: ch = 0xCD; break; - case 0x2551: ch = 0xBA; break; - case 0x2552: ch = 0xD5; break; - case 0x2553: ch = 0xD6; break; - case 0x2554: ch = 0xC9; break; - case 0x2555: ch = 0xB8; break; - case 0x2556: ch = 0xB7; break; - case 0x2557: ch = 0xBB; break; - case 0x2558: ch = 0xD4; break; - case 0x2559: ch = 0xD3; break; - case 0x255A: ch = 0xC8; break; - case 0x255B: ch = 0xBE; break; - case 0x255C: ch = 0xBD; break; - case 0x255D: ch = 0xBC; break; - case 0x255E: ch = 0xC6; break; - case 0x255F: ch = 0xC7; break; - case 0x2560: ch = 0xCC; break; - case 0x2561: ch = 0xB5; break; - case 0x2562: ch = 0xB6; break; - case 0x2563: ch = 0xB9; break; - case 0x2564: ch = 0xD1; break; - case 0x2565: ch = 0xD2; break; - case 0x2566: ch = 0xCB; break; - case 0x2567: ch = 0xCF; break; - case 0x2568: ch = 0xD0; break; - case 0x2569: ch = 0xCA; break; - case 0x256A: ch = 0xD8; break; - case 0x256B: ch = 0xD7; break; - case 0x256C: ch = 0xCE; break; - case 0x2580: ch = 0xDF; break; - case 0x2584: ch = 0xDC; break; - case 0x2588: ch = 0xDB; break; - case 0x258C: ch = 0xDD; break; - case 0x2590: ch = 0xDE; break; - case 0x2591: ch = 0xB0; break; - case 0x2592: ch = 0xB1; break; - case 0x2593: ch = 0xB2; break; - case 0x25A0: ch = 0xFE; break; - case 0x25AC: ch = 0x16; break; - case 0x25B2: ch = 0x1E; break; - case 0x25BA: ch = 0x10; break; - case 0x25BC: ch = 0x1F; break; - case 0x25C4: ch = 0x11; break; - case 0x25CB: ch = 0x09; break; - case 0x25D8: ch = 0x08; break; - case 0x25D9: ch = 0x0A; break; - case 0x263A: ch = 0x01; break; - case 0x263B: ch = 0x02; break; - case 0x263C: ch = 0x0F; break; - case 0x2640: ch = 0x0C; break; - case 0x2642: ch = 0x0B; break; - case 0x2660: ch = 0x06; break; - case 0x2663: ch = 0x05; break; - case 0x2665: ch = 0x03; break; - case 0x2666: ch = 0x04; break; - case 0x266A: ch = 0x0D; break; - case 0x266B: ch = 0x0E; break; - case 0xFFE8: ch = 0xB3; break; - case 0xFFE9: ch = 0x1B; break; - case 0xFFEA: ch = 0x18; break; - case 0xFFEB: ch = 0x1A; break; - case 0xFFEC: ch = 0x19; break; - case 0xFFED: ch = 0xFE; break; - case 0xFFEE: ch = 0x09; break; - default: - { - if(ch >= 0xFF01 && ch <= 0xFF5E) - { - ch -= 0xFEE0; - } - else - { - ch = 0x3F; - } - } - break; - } - bytes[byteIndex++] = (byte)ch; - --charCount; - } - } - */ - }; // class CP865 [Serializable] diff --git a/mcs/class/I18N/tools/.gitignore b/mcs/class/I18N/tools/.gitignore new file mode 100644 index 00000000000..a31034c5203 --- /dev/null +++ b/mcs/class/I18N/tools/.gitignore @@ -0,0 +1 @@ +/ucm2cp diff --git a/mcs/class/I18N/tools/ucm2cp.c b/mcs/class/I18N/tools/ucm2cp.c index 51c721b0d85..72e185197ee 100644 --- a/mcs/class/I18N/tools/ucm2cp.c +++ b/mcs/class/I18N/tools/ucm2cp.c @@ -648,12 +648,11 @@ static void printCharToByte(void) printf("\t\t\treturn GetBytesImpl(chars, count, null, 0);\n"); printf("\t\t}\n"); printf("\t\telse\n"); - printf("\t\t\n"); printf("\t\t{\n"); printf("\t\t\treturn count;\n"); printf("\t\t}\n"); printf("\t}\n"); - printf("\t\n"); + printf("\n"); printf("\t// Get the number of bytes needed to encode a character buffer.\n"); printf("\tpublic override int GetByteCount (String s)\n"); printf("\t{\n"); @@ -674,7 +673,7 @@ static void printCharToByte(void) printf("\t\t\treturn s.Length;\n"); printf("\t\t}\n"); printf("\t}\n"); - printf("\t\n"); + printf("\n"); printf("\t//ToBytes is just an alias for GetBytesImpl, but doesn't return byte count\n"); printf("\tprotected unsafe override void ToBytes(char* chars, int charCount,\n"); printf("\t byte* bytes, int byteCount)\n"); @@ -684,7 +683,7 @@ static void printCharToByte(void) printf("\t\t\tthrow new ArgumentNullException(\"bytes\");\n"); printf("\t\tGetBytesImpl(chars, charCount, bytes, byteCount);\n"); printf("\t}\n"); - printf("\t\n"); + printf("\n"); /* Print the conversion method for character buffers */ //printf("\tprotected unsafe override void ToBytes(char* chars, int charCount,\n"); @@ -709,21 +708,5 @@ static void printCharToByte(void) printf("\t\t\tcharCount--;\n"); printf("\t\t}\n"); printf("\t\treturn byteIndex;\n"); - printf("\t}\n\n"); - - /* Print the conversion method for string buffers */ - printf("\t/*\n"); - printf("\tprotected override void ToBytes(String s, int charIndex, int charCount,\n"); - printf("\t byte[] bytes, int byteIndex)\n"); - printf("\t{\n"); - printf("\t\tint ch;\n"); - printf("\t\twhile(charCount > 0)\n"); - printf("\t\t{\n"); - printf("\t\t\tch = (int)(s[charIndex++]);\n"); - printConvertSwitch(1); - printf("\t\t\tbytes[byteIndex++] = (byte)ch;\n"); - printf("\t\t\t--charCount;\n"); - printf("\t\t}\n"); printf("\t}\n"); - printf("\t*/\n\n"); } |