mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Read all files as UTF-8 (#1035)
Fix encoding issues with some languages such as Chinese by forcing UTF-8 everywhere. Configuration files written in ANSI/Latin-1 and other encodings will need conversion.
This commit is contained in:
parent
cf9bc4c3d5
commit
20fb2323a4
9 changed files with 12 additions and 10 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace MinecraftClient.Mapping.BlockPalettes
|
||||
{
|
||||
|
|
@ -11,7 +12,7 @@ namespace MinecraftClient.Mapping.BlockPalettes
|
|||
public static class BlockPaletteGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// Generate mapping from Minecraft blocks.jsom
|
||||
/// Generate mapping from Minecraft blocks.json
|
||||
/// </summary>
|
||||
/// <param name="blocksJsonFile">path to blocks.json</param>
|
||||
/// <param name="outputClass">output path for blocks.cs</param>
|
||||
|
|
@ -23,7 +24,7 @@ namespace MinecraftClient.Mapping.BlockPalettes
|
|||
HashSet<int> knownStates = new HashSet<int>();
|
||||
Dictionary<string, HashSet<int>> blocks = new Dictionary<string, HashSet<int>>();
|
||||
|
||||
Json.JSONData palette = Json.ParseJson(File.ReadAllText(blocksJsonFile));
|
||||
Json.JSONData palette = Json.ParseJson(File.ReadAllText(blocksJsonFile, Encoding.UTF8));
|
||||
foreach (KeyValuePair<string, Json.JSONData> item in palette.Properties)
|
||||
{
|
||||
//minecraft:item_name => ItemName
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue