スタイル: コーディング規約に準拠したコードフォーマットの適用(this.の明示、空白スタイルの統一)
- 自インスタンスメンバーアクセスへの this. 付与(28ファイル) - .editorconfig に準拠したインデント・波括弧・空白スタイルの適用 - UTF-8 (BOMあり)、CRLF改行コード、行末空白除去の整合性検証
This commit is contained in:
1 parent
2fa40c950f
commit
ae86b53147
28 files changed
+1362
-1380
No files matched your search
@@ -52,7 +52,7 @@ namespace GameLauncher.Engines.Rgss.Games.IiniTitleRepair
|
||||
var trim = line.Trim();
|
||||
if (trim.StartsWith("Title=", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var val = trim.Substring(6).Trim();
|
||||
var val = trim[6..].Trim();
|
||||
if (!string.IsNullOrWhiteSpace(val) && !val.Contains('\uFFFD'))
|
||||
{
|
||||
tg.Title = val;
|
||||
@@ -73,23 +73,23 @@ namespace GameLauncher.Engines.Rgss.Games.IiniTitleRepair
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(filePath)) return Array.Empty<string>();
|
||||
if (!File.Exists(filePath)) return [];
|
||||
|
||||
byte[] bytes = File.ReadAllBytes(filePath);
|
||||
if (bytes.Length == 0) return Array.Empty<string>();
|
||||
if (bytes.Length == 0) return [];
|
||||
|
||||
// 1. UTF-8 BOM (EF BB BF)
|
||||
if (bytes.Length >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF)
|
||||
{
|
||||
var text = System.Text.Encoding.UTF8.GetString(bytes, 3, bytes.Length - 3);
|
||||
return text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
|
||||
return text.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);
|
||||
}
|
||||
|
||||
// 2. UTF-16 LE BOM (FF FE)
|
||||
if (bytes.Length >= 2 && bytes[0] == 0xFF && bytes[1] == 0xFE)
|
||||
{
|
||||
var text = System.Text.Encoding.Unicode.GetString(bytes, 2, bytes.Length - 2);
|
||||
return text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
|
||||
return text.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);
|
||||
}
|
||||
|
||||
// 3. Shift_JIS (CP932)
|
||||
@@ -104,11 +104,11 @@ namespace GameLauncher.Engines.Rgss.Games.IiniTitleRepair
|
||||
}
|
||||
|
||||
var decoded = encoding.GetString(bytes);
|
||||
return decoded.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
|
||||
return decoded.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return Array.Empty<string>();
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user