|
|
|
@ -26,6 +26,7 @@ package net.yacy.cora.document;
|
|
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
|
|
|
|
|
|
import org.apache.http.entity.mime.content.StringBody;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -51,7 +52,7 @@ public class UTF8 {
|
|
|
|
|
public final static StringBody StringBody(final String s) {
|
|
|
|
|
try {
|
|
|
|
|
return new StringBody(s, charset);
|
|
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
|
|
} catch (final UnsupportedEncodingException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -64,7 +65,7 @@ public class UTF8 {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public final static String String(final byte[] bytes) {
|
|
|
|
|
return new String(bytes, charset);
|
|
|
|
|
return new String(bytes, 0, bytes.length, charset);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public final static String String(final byte[] bytes, final int offset, final int length) {
|
|
|
|
|