From adfe0a6cea6fe5f07f9c02320544c75011070eae Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 22 May 2018 17:46:35 +0400 Subject: [PATCH] (StringExtensions): ToLowerShiftJis method overload for byte arrays. --- ArcFormats/ArcCommon.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ArcFormats/ArcCommon.cs b/ArcFormats/ArcCommon.cs index 866692a3..0e5a0f7a 100644 --- a/ArcFormats/ArcCommon.cs +++ b/ArcFormats/ArcCommon.cs @@ -184,6 +184,12 @@ namespace GameRes.Formats public static byte[] ToLowerShiftJis (this string 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) { byte c = text_bytes[i]; @@ -192,7 +198,6 @@ namespace GameRes.Formats else if (c > 0x7F && c < 0xA1 || c > 0xDF) ++i; } - return text_bytes; } }