2008-10-29 4 views

답변

1
import java.nio.ByteBuffer 
import java.nio.CharBuffer 

.... 또한

+0

아직 제대로 작동하지 않습니다 !!! – user21508

1
private byte[] convertTis620ToUTF8(byte[] encoded) 
{ 
    try 
    { 
     String theString = new String(encoded, "TIS620"); 
     return theString.getBytes("UTF-8"); 
    } 
    catch(UnsupportedEncodingException uee) 
    { 
     /* Didn't work out */ 
    } 
} 

... 

byte[] utf8 = convertTis620ToUTF8(tis620); 

인코딩 인수 "UTF-8"로

public static ByteBuffer toByteBuffer(String content, String encode) { 
     Charset charset = Charset.forName(encode); 
     ByteBuffer bb = charset.encode(content); 
     return bb; 
    } 

패스, 당신은을 지원하기 위해 클래스 경로에하면 charsets.jar을 넣어해야 할 수도 있습니다 TIS620 인코딩.

관련 문제