mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(StringExtensions): ToLowerShiftJis method overload for byte arrays.
This commit is contained in:
@@ -184,6 +184,12 @@ namespace GameRes.Formats
|
|||||||
public static byte[] ToLowerShiftJis (this string text)
|
public static byte[] ToLowerShiftJis (this string text)
|
||||||
{
|
{
|
||||||
var text_bytes = Encodings.cp932.GetBytes (text);
|
var text_bytes = Encodings.cp932.GetBytes (text);
|
||||||
|
text_bytes.ToLowerShiftJis();
|
||||||
|
return text_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ToLowerShiftJis (this byte[] text_bytes)
|
||||||
|
{
|
||||||
for (int i = 0; i < text_bytes.Length; ++i)
|
for (int i = 0; i < text_bytes.Length; ++i)
|
||||||
{
|
{
|
||||||
byte c = text_bytes[i];
|
byte c = text_bytes[i];
|
||||||
@@ -192,7 +198,6 @@ namespace GameRes.Formats
|
|||||||
else if (c > 0x7F && c < 0xA1 || c > 0xDF)
|
else if (c > 0x7F && c < 0xA1 || c > 0xDF)
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
return text_bytes;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user