From bf225f51e177c9da36a5016d96538391e9c1ce8e Mon Sep 17 00:00:00 2001 From: claude-bot Date: Mon, 18 May 2026 21:22:44 +0900 Subject: [PATCH] installer: force fabric-installer JVM stdout to UTF-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Korean Windows defaults the JVM's stdout to cp949 (MS949), so the fabric-installer's Korean status lines came through as mojibake when Node decoded them as UTF-8 (e.g. "���가져오는중 (org.ow2.asm:asm:9.9)"). Pass -Dfile.encoding/-Dstdout.encoding/-Dstderr.encoding=UTF-8 before -jar so the JVM writes UTF-8 and our existing utf-8 decode matches. stdout/stderr.encoding properties take effect on Java 18+; file.encoding covers older JDKs. Co-Authored-By: Claude Opus 4.7 --- package.json | 2 +- src/installer/main.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ca7103..8bc70dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-music-quiz-installer", - "version": "0.2.3", + "version": "0.2.4", "description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트", "main": "dist/installer/main.js", "scripts": { diff --git a/src/installer/main.ts b/src/installer/main.ts index 6511f7b..c5fb3f4 100644 --- a/src/installer/main.ts +++ b/src/installer/main.ts @@ -1219,7 +1219,16 @@ async function installFabricLoader(pack: PackDefinition, customRoot: string): Pr // 4) fabric-installer CLI 자동 실행. // client 모드 + -noprofile: launcher_profiles.json 은 우리 코드가 직접 갱신하므로 fabric-installer 가 덮어쓰지 않게 한다. + // JVM stdout 인코딩 강제 UTF-8: + // 한국 윈도우의 시스템 codepage 는 cp949(MS949) 라서 fabric-installer 가 + // 한글을 cp949 로 stdout 에 쓰면 우리가 utf-8 로 디코드해서 깨져 보인다. + // `file.encoding` 은 default Charset, `stdout/stderr.encoding` 은 + // System.out/err 의 PrintStream 인코딩(Java 18+). 둘 다 지정하면 + // 구버전·신버전 JDK 모두에서 안전. const args = [ + '-Dfile.encoding=UTF-8', + '-Dstdout.encoding=UTF-8', + '-Dstderr.encoding=UTF-8', '-jar', installerJar, 'client', '-mcversion', pack.mcVersion,