We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7043ecd commit aaa70d2Copy full SHA for aaa70d2
1 file changed
org.eclipse.paho.mqttv5.common/src/main/java/org/eclipse/paho/mqttv5/common/packet/MqttDataTypes.java
@@ -170,7 +170,9 @@ public static String decodeUTF8(DataInputStream input) throws MqttException {
170
private static void validateUTF8String(String input) throws IllegalArgumentException {
171
for (int i = 0; i < input.length(); i++) {
172
char c = input.charAt(i);
173
- if (Character.getType(c) == Character.CONTROL || Character.getType(c) == Character.UNASSIGNED) {
+ if (Character.getType(c) == Character.CONTROL ||
174
+ Character.getType(c) == Character.UNASSIGNED ||
175
+ Character.getType(c) == Character.SURROGATE) {
176
throw new IllegalArgumentException(String.format("Invalid UTF-8 char: %s [%s]", c, (int) c));
177
}
178
0 commit comments