Piped-Backend/src/main/java/me/kavin/piped/utils/URLUtils.java

26 lines
547 B
Java
Raw Normal View History

2020-11-12 21:19:45 +00:00
package me.kavin.piped.utils;
import java.net.URLDecoder;
2020-11-12 21:19:45 +00:00
import java.net.URLEncoder;
public class URLUtils {
public static String silentEncode(String s) {
2021-02-24 09:52:29 +00:00
try {
return URLEncoder.encode(s, "UTF-8");
} catch (Exception e) {
// ignored
}
return s;
2020-11-12 21:19:45 +00:00
}
public static String silentDecode(String s) {
try {
return URLDecoder.decode(s, "UTF-8");
} catch (Exception e) {
// ignored
}
return s;
}
2020-11-12 21:19:45 +00:00
}