You've already forked linux-packaging-mono
Imported Upstream version 4.0.1
Former-commit-id: 757121caeaad523350be5330f0a3ecc891c70fb8
This commit is contained in:
@@ -29,6 +29,9 @@ namespace System.Text
|
||||
// Unicode version 2.0 character size in bytes
|
||||
public const int CharSize = 2;
|
||||
|
||||
// endianness-based bit pattern mask.
|
||||
static readonly ulong highLowPatternMask = ((ulong) 0xd800d800d800d800 | (BitConverter.IsLittleEndian ? (ulong) 0x0400000004000000 : (ulong) 0x0000040000000400));
|
||||
|
||||
|
||||
public UnicodeEncoding()
|
||||
: this(false, true)
|
||||
@@ -533,11 +536,7 @@ namespace System.Text
|
||||
|
||||
// If they happen to be high/low/high/low, we may as well continue. Check the next
|
||||
// bit to see if its set (low) or not (high) in the right pattern
|
||||
#if BIGENDIAN
|
||||
if (((0xfc00fc00fc00fc00 & *longChars) ^ 0xd800dc00d800dc00) != 0)
|
||||
#else
|
||||
if (((0xfc00fc00fc00fc00 & *longChars) ^ 0xdc00d800dc00d800) != 0)
|
||||
#endif
|
||||
if (((0xfc00fc00fc00fc00 & *longChars) ^ highLowPatternMask) != 0)
|
||||
{
|
||||
// Either there weren't 4 surrogates, or the 0x0400 bit was set when a high
|
||||
// was hoped for or the 0x0400 bit wasn't set where a low was hoped for.
|
||||
@@ -823,11 +822,7 @@ namespace System.Text
|
||||
|
||||
// If they happen to be high/low/high/low, we may as well continue. Check the next
|
||||
// bit to see if its set (low) or not (high) in the right pattern
|
||||
#if BIGENDIAN
|
||||
if (((0xfc00fc00fc00fc00 & *longChars) ^ 0xd800dc00d800dc00) != 0)
|
||||
#else
|
||||
if (((0xfc00fc00fc00fc00 & *longChars) ^ 0xdc00d800dc00d800) != 0)
|
||||
#endif
|
||||
if (((0xfc00fc00fc00fc00 & *longChars) ^ highLowPatternMask) != 0)
|
||||
{
|
||||
// Either there weren't 4 surrogates, or the 0x0400 bit was set when a high
|
||||
// was hoped for or the 0x0400 bit wasn't set where a low was hoped for.
|
||||
@@ -1228,11 +1223,7 @@ namespace System.Text
|
||||
|
||||
// If they happen to be high/low/high/low, we may as well continue. Check the next
|
||||
// bit to see if its set (low) or not (high) in the right pattern
|
||||
#if BIGENDIAN
|
||||
if (((0xfc00fc00fc00fc00 & *longBytes) ^ 0xd800dc00d800dc00) != 0)
|
||||
#else
|
||||
if (((0xfc00fc00fc00fc00 & *longBytes) ^ 0xdc00d800dc00d800) != 0)
|
||||
#endif
|
||||
if (((0xfc00fc00fc00fc00 & *longBytes) ^ highLowPatternMask) != 0)
|
||||
{
|
||||
// Either there weren't 4 surrogates, or the 0x0400 bit was set when a high
|
||||
// was hoped for or the 0x0400 bit wasn't set where a low was hoped for.
|
||||
@@ -1560,11 +1551,7 @@ namespace System.Text
|
||||
|
||||
// If they happen to be high/low/high/low, we may as well continue. Check the next
|
||||
// bit to see if its set (low) or not (high) in the right pattern
|
||||
#if BIGENDIAN
|
||||
if (((0xfc00fc00fc00fc00 & *longBytes) ^ 0xd800dc00d800dc00) != 0)
|
||||
#else
|
||||
if (((0xfc00fc00fc00fc00 & *longBytes) ^ 0xdc00d800dc00d800) != 0)
|
||||
#endif
|
||||
if (((0xfc00fc00fc00fc00 & *longBytes) ^ highLowPatternMask) != 0)
|
||||
{
|
||||
// Either there weren't 4 surrogates, or the 0x0400 bit was set when a high
|
||||
// was hoped for or the 0x0400 bit wasn't set where a low was hoped for.
|
||||
|
Reference in New Issue
Block a user