diff options
author | Mikko Korkalo <mikko@korkalo.fi> | 2013-02-11 11:26:26 +0400 |
---|---|---|
committer | Mikko Korkalo <mikko@korkalo.fi> | 2013-02-11 11:26:26 +0400 |
commit | 1ed1fcdde699607e36a6484e1e62017faec73816 (patch) | |
tree | 9b5f44863689fa4f4b3fe1acaa0e2b7b6674c456 /mcs/class/I18N/Rare/CP864.cs | |
parent | 66a26049aa5417e9c6e0135b98c502471f669034 (diff) |
re-generated codepages with new ucm2cp.c: removed dotnet 1.0 support for cleaner code
Diffstat (limited to 'mcs/class/I18N/Rare/CP864.cs')
-rw-r--r-- | mcs/class/I18N/Rare/CP864.cs | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/mcs/class/I18N/Rare/CP864.cs b/mcs/class/I18N/Rare/CP864.cs index 6b0f86b467e..1513327e132 100644 --- a/mcs/class/I18N/Rare/CP864.cs +++ b/mcs/class/I18N/Rare/CP864.cs @@ -138,15 +138,16 @@ public class CP864 : ByteEncoding byte* bytes, int byteCount) { int ch; - int charIndex; + int charIndex = 0; int byteIndex = 0; #if NET_2_0 EncoderFallbackBuffer buffer = null; #endif - for (charIndex=0; charCount > 0; charIndex++, charCount--) + while (charCount > 0) { ch = (int)(chars[charIndex]); - bool fallback = false; + charIndex++; + charCount--; if(ch >= 26) switch(ch) { case 0x001B: @@ -517,29 +518,17 @@ public class CP864 : ByteEncoding } else { -#if NET_2_0 - //Execute fallback routine and set fallback flag on HandleFallback (ref buffer, chars, ref charIndex, ref charCount, bytes, ref byteIndex, ref byteCount); - fallback = true; -#else - ch = 0x3F; -#endif + continue; } } break; } //Write encoded byte to buffer, if buffer is defined and fallback was not used - if (bytes != null && !fallback) - { + if (bytes != null) bytes[byteIndex] = (byte)ch; - } - - //Bump counters if fallback was not used - if (!fallback) - { - byteIndex++; - byteCount--; - } + byteIndex++; + byteCount--; } return byteIndex; } |