Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -44,12 +44,8 @@ namespace I18N.CJK
byte b1 = convert.u2n[((int)c) * 2 + 1];
byte b2 = convert.u2n[((int)c) * 2];
if (b1 == 0 && b2 == 0) {
#if NET_2_0
// FIXME: handle fallback for GetByteCountImpl().
length++;
#else
length++;
#endif
}
else
length += 2;
@@ -65,9 +61,7 @@ namespace I18N.CJK
int charIndex = 0;
int byteIndex = 0;
int end = charCount;
#if NET_2_0
EncoderFallbackBuffer buffer = null;
#endif
int origIndex = byteIndex;
for (int i = charIndex; i < end; i++, charCount--)
@@ -80,13 +74,9 @@ namespace I18N.CJK
byte b1 = convert.u2n[((int)c) * 2 + 1];
byte b2 = convert.u2n[((int)c) * 2];
if (b1 == 0 && b2 == 0) {
#if NET_2_0
HandleFallback (ref buffer, chars,
ref i, ref charCount,
bytes, ref byteIndex, ref byteCount, null);
#else
bytes[byteIndex++] = (byte)'?';
#endif
} else {
bytes[byteIndex++] = b1;
bytes[byteIndex++] = b2;
@@ -113,12 +103,8 @@ namespace I18N.CJK
byte b2 = convert.u2n[((int)c) * 2];
if (b1 == 0 && b2 == 0)
{
#if NET_2_0
// FIXME: handle fallback for GetByteCountImpl().
length++;
#else
length++;
#endif
}
else
length += 2;
@@ -133,9 +119,7 @@ namespace I18N.CJK
int end = charIndex + charCount;
DbcsConvert convert = GetConvert();
#if NET_2_0
EncoderFallbackBuffer buffer = null;
#endif
int origIndex = byteIndex;
for (int i = charIndex; i < end; i++, charCount--)
@@ -150,12 +134,8 @@ namespace I18N.CJK
byte b2 = convert.u2n[((int)c) * 2];
if (b1 == 0 && b2 == 0)
{
#if NET_2_0
HandleFallback (ref buffer, chars, ref i, ref charCount,
bytes, ref byteIndex, ref byteCount, null);
#else
bytes[byteIndex++] = (byte)'?';
#endif
}
else
{
@@ -259,9 +239,7 @@ namespace I18N.CJK
return GetCharCount (bytes, index, count, false);
}
#if NET_2_0
public override
#endif
int GetCharCount (byte[] bytes, int index, int count, bool refresh)
{
CheckRange (bytes, index, count);
@@ -311,9 +289,7 @@ namespace I18N.CJK
return GetChars (bytes, byteIndex, byteCount, chars, charIndex, false);
}
#if NET_2_0
public override
#endif
int GetChars(byte[] bytes, int byteIndex, int byteCount,
char[] chars, int charIndex, bool refresh)
{