mirror of
https://github.com/TeamPiped/Piped-Backend
synced 2025-09-10 04:37:08 +02:00
26 lines
547 B
Java
26 lines
547 B
Java
package me.kavin.piped.utils;
|
|
|
|
import java.net.URLDecoder;
|
|
import java.net.URLEncoder;
|
|
|
|
public class URLUtils {
|
|
|
|
public static String silentEncode(String s) {
|
|
try {
|
|
return URLEncoder.encode(s, "UTF-8");
|
|
} catch (Exception e) {
|
|
// ignored
|
|
}
|
|
return s;
|
|
}
|
|
|
|
public static String silentDecode(String s) {
|
|
try {
|
|
return URLDecoder.decode(s, "UTF-8");
|
|
} catch (Exception e) {
|
|
// ignored
|
|
}
|
|
return s;
|
|
}
|
|
}
|