반응형
?? ?? ?????????
로만 표시되길래 고생해서 해결방법을 찾아서 공유하려고 이 글을 작성.
## PH
- 2023-09-25 : First posting.
runJava.bat
and runJavaC.sublime-build
아래가 runJava.bat
파일 내용 :
```[.linenums.lang-bat]
@REM encoding must be EUC-KR with Korean folder name.
@ECHO OFF
:: destination of class to be created
SET DC=C:\Recoeve\classes
:: The whole CLASSPATH list splited by ";"
@REM SET CLASSPATH=.;%JAVA_HOME%\lib;%RECOEVE_CLASS%\classes;%RECOEVE_CLASS%\classes\javax.mail.jar;%RECOEVE_CLASS%\classes\mysql-connector-j-8.0.33.jar;%RECOEVE_CLASS%\classes\activation-1.1.1.jar;%VERTX_HOME%\conf;%VERTX_HOME%\lib\*
:: %~nx1 expands %1 [arg 1] to "file name + extension". e.g. "HelloWorld.java"
ECHO Compiling %~nx1
:: Compile %~nx1 with {filename:%~nx1, encoding:UTF-8, destination:%DC%, classpath:%CLASSPATH%}
javac %~nx1 -encoding UTF-8 -d "%DC%" -classpath "%CLASSPATH%"
IF NOT %ERRORLEVEL%==0 GOTO :EOF
:: source directory
SET SD=%CD%
@REM or SET SD=%~dp1
:: %SD%\%~n1 gives [source directory]\file_name. e.g. "C:\Recoeve\sources\kipid\hello\HelloWorld".
SET packSD=%SD%\%~n1
@REM or SET packSD=%~dpn1
:: Replace "C:\Recoeve\sources\" to "" [empty] of %packSD%. e.g. "kipid\hello\HelloWorld".
SET CN=%packSD:C:\Recoeve\sources\=%
:: Replace "\" to "." of %cn%. e.g. "kipid.hello.HelloWorld"
:: This is a class name with JAVA package included.
SET CN=%CN:\=.%
ECHO --- OUTPUT: %CN% %2 %3 %4 %5 %6 %7 %8 %9 ---
:: Change directory to the %DC% [destination of class to be created].
CD %DC%
:: Run/Execute the class created.
java -Dfile.encoding=UTF-8 -classpath "%CLASSPATH%" %CN% %2 %3 %4 %5 %6 %7 %8 %9
:: Back to source directory
CD %SD%
```/
아래가 runJavaC.sublime-build
파일 내용 :
```[.linenums.lang-json]
{
"cmd": ["runJava.bat", "$file"]
// , "file_regex": "^(...*?):([0-9]*):?([0-9]*)"
, "selector": "source.java"
, "encoding": "utf-8" // "cp949"
}
```/
## Build results of Sublime text
한글이 출력되는 곳에
```
?? ?? ??????? ?????????
```/
와 같이 물음표로 표시되거나 이상한 문양으로 출력되는 경우가 있었는데, 윈도우에 언어팩도 안깔려 있었고, 인코딩 (Encoding) 도 일치하지 않아서 발생한 문제였음.
## Windows language settings (위도우 언어 설정)
다국어 지원을 위해서는 UTF-8
인코딩 (Encoding) 을 사용하는 것이 좋은데, 대부분의 한글 윈도우 (Windows) 는 기본적으로 cp949
나 euc-kr
인코딩 (Encoding) 을 쓰는 경우가 많다.
영어 윈도우 (English Windows) 의 경우도 인코딩 (Encoding) 을 UTF-8
을 안쓰는 경우가 많은것 같은데 윈도우 언어 설정 및 인코딩 (Encoding) 을 UTF-8
로 바꾸는 방법에 대해 알아봅시다.
시간 및 언어
(Timezone and Language
) 설정에 들어가서 기본 언어 설정
을 클릭하면 작은 창이 뜹니다.
여기서 시스템 로캘 변경
을 클릭한 뒤,
UTF-8
로 곳곳에서 바꾸시면 한글이 제대로 뜰 겁니다.
한글 기본 Encoding 이 UTF-8 이 아니다 보니 이 UTF-8 로 짠 한글로된 프로그램은 한글이 또 깨져보일수가 있음. 이건 어쩔수 없는거 같음. 이 회사들이 UTF-8 Encoding 으로 다시 프로그래밍을 해주길 바라는 수밖에 =ㅇ=;;;
## RRA
반응형
'[IT/Programming]' 카테고리의 다른 글
카카오톡 채널 광고 차단하는 법 (0) | 2023.10.27 |
---|---|
Installing and Learning JAVA (0) | 2023.10.26 |
To correct inaccurate location measured by GPS with Wi-Fi RSSI (Received Signal Strength Indicatior). (Wi-Fi 신호세기를 이용해 GPS 튀는거 잡는 방법.) (0) | 2023.10.25 |
Sublime Text (editor) 소개 (2) | 2023.10.25 |
정렬법 (Sorting Algorithm) (0) | 2023.06.01 |
Open AI chatbot ChatGPT 가 신 (GOD) 이 될 수 있을까? (0) | 2023.05.30 |
Web site - 다국어 지원 (multi-language support) (0) | 2022.12.28 |