Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConvertWithLeftOverChar() [2/2]

unsafe int System.Text.OSEncoder.ConvertWithLeftOverChar ( char * chars,
int count,
byte * bytes,
int byteCount )
inlineprivate

Definition at line 48 of file OSEncoder.cs.

49 {
50 char* ptr = stackalloc char[2];
51 *ptr = _charLeftOver;
52 int num = 0;
53 if (count > 0 && char.IsLowSurrogate(*chars))
54 {
55 ptr[1] = *chars;
56 num++;
57 }
58 int num2 = OSEncoding.WideCharToMultiByte(_encoding.CodePage, ptr, num + 1, bytes, byteCount);
59 if (count - num > 0)
60 {
61 num2 += OSEncoding.WideCharToMultiByte(_encoding.CodePage, chars + num, count - num, (bytes == null) ? null : (bytes + num2), (bytes != null) ? (byteCount - num2) : 0);
62 }
63 return num2;
64 }
virtual int CodePage
Definition Encoding.cs:515
readonly Encoding _encoding
Definition OSEncoder.cs:9

References System.Text.OSEncoder._charLeftOver, System.Text.OSEncoder._encoding, System.byteCount, System.bytes, System.chars, System.Text.Encoding.CodePage, System.count, and System.Text.OSEncoding.WideCharToMultiByte().