Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- googlevr
- U+알뜰모바일
- #android
- VR
- 언리얼인강
- file인코딩
- vr컨트롤러
- Unity
- 유플러스알뜰모바일
- 오민랩
- #패키지네임
- 토이클래시
- sliceNdice
- 갤럭시s9+
- unreal인강
- 5민랩
- 유니티
- 블루투스cd플레이어
- sprite
- resources.load
- unreal4
- toyclash
- 드로우콜
- 슬라이스앤다이스
- slice&dice
- smi인코딩
- #앱아이콘
- GearVR
- vr controller
- gearvrcontroller
Archives
- Today
- Total
야로레 노트
안드로이드 (JAVA) 에서 한글(EUC-KR 또는 UTF-8)을 자동 판단 하는 방법~ 본문
SMI 자막 파일 로드할때 인코딩때문에 애먹었는데 이걸로 해결 .
외부로 부터 전달받은 한글문자열이 EUC-KR인지 UTF-8인지 판단이 필요할때
사용될수 있는 소스 입니다.
해당 소스는 자동으로 LocalString으로 변경해 줍니다.
public static String LocalString( byte[] b)
{
try {
CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder();
try {
CharBuffer r = decoder.decode( ByteBuffer.wrap( b));
return r.toString();
} catch (CharacterCodingException e) {
return new String( b, "EUC-KR");
}
} catch (UnsupportedEncodingException e1) {
Log.d("Unity", e1.getMessage());
}
return null;
}
출처: http://symlink.tistory.com/20 [날개를 펴다]
'프로그래밍 > 안드로이드' 카테고리의 다른 글
앱 정보들 가지고 오기 (0) | 2017.09.19 |
---|---|
현재 어플리케이션 정보 받기 (0) | 2017.09.19 |
Comments