make sure enclosure urls fit in the database field

This commit is contained in:
Athou
2013-05-23 10:03:15 +02:00
parent c9f2b545c9
commit f9cfea4f79
4 changed files with 14 additions and 12 deletions

View File

@@ -20,6 +20,13 @@ import com.google.api.client.util.Lists;
public class FeedUtils {
public static String truncate(String string, int length) {
if (string != null) {
string = string.substring(0, Math.min(length, string.length()));
}
return string;
}
public static String guessEncoding(byte[] bytes) {
String DEFAULT_ENCODING = "UTF-8";
UniversalDetector detector = new UniversalDetector(null);