Detect encoding of URL in Java
I have a case of mixed Data in a Database, and I am trying to see if this is a problem that can be solved. What I have is a partial URL in one of three formats:/some/path?ugly=häßlich // case 1,...
View ArticleAnswer by s106mo for Detect encoding of URL in Java
If you can assume that only alphanumerics are encoded, following woud work for:"häßlich""h%C3%A4%C3%9Flich""h%E4%DFlich"// check firstly:public static boolean isUtf8Encoded(String url) { return...
View ArticleAnswer by user1079877 for Detect encoding of URL in Java
Thanks to accepted answer, but it does not work for URL, because URL also contains control characters, this is my solution:/** * List of valid characters in URL. */private static final List...
View ArticleAnswer by Elsayed for Detect encoding of URL in Java
you can make work around as you first decode then encode , if you have unencoded url it isn't affected by decoding String url = "your url"; url=URIUtil.decode(url, "UTF-8");...
View Article