Avoid UnsupportedEncodingException & use const from StandardCharsets (#11948)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
committed by
GitHub
parent
3f54327d5a
commit
167f8ebc49
@@ -14,7 +14,6 @@ package org.openhab.binding.shelly.internal.util;
|
||||
|
||||
import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URLEncoder;
|
||||
@@ -271,11 +270,7 @@ public class ShellyUtils {
|
||||
}
|
||||
|
||||
public static String urlEncode(String input) {
|
||||
try {
|
||||
return URLEncoder.encode(input, StandardCharsets.UTF_8.toString());
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return input;
|
||||
}
|
||||
return URLEncoder.encode(input, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public static Long now() {
|
||||
|
||||
Reference in New Issue
Block a user