installer: force fabric-installer JVM stdout to UTF-8

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 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 21:22:44 +09:00
parent 2371af4411
commit bf225f51e1
2 changed files with 10 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "minecraft-music-quiz-installer",
"version": "0.2.3",
"version": "0.2.4",
"description": "마인크래프트 음악퀴즈 간편설치기 + 관리 사이트",
"main": "dist/installer/main.js",
"scripts": {

View File

@@ -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,