1 11 package org.eclipse.core.internal.indexing; 12 13 import java.io.UnsupportedEncodingException ; 14 15 class Convert { 16 17 20 static String fromUTF8(byte[] b) { 21 String result; 22 try { 23 result = new String (b, "UTF8"); } catch (UnsupportedEncodingException e) { 25 result = new String (b); 26 } 27 return result; 28 } 29 30 33 static byte[] toUTF8(String s) { 34 byte[] result; 35 try { 36 result = s.getBytes("UTF8"); } catch (UnsupportedEncodingException e) { 38 result = s.getBytes(); 39 } 40 return result; 41 } 42 } 43 | Popular Tags |