diff --git a/drongo b/drongo index e15eb7c7..d7b97c99 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit e15eb7c7f36756c35577d61bfd793b2a2502cf93 +Subproject commit d7b97c99dcd1aa593e7c4354652cd8068aaaeccb diff --git a/src/main/java/net/sourceforge/zbar/ZBar.java b/src/main/java/net/sourceforge/zbar/ZBar.java index 112b8580..abe136a3 100644 --- a/src/main/java/net/sourceforge/zbar/ZBar.java +++ b/src/main/java/net/sourceforge/zbar/ZBar.java @@ -49,7 +49,7 @@ public class ZBar { Scan scan = null; for(Iterator iter = results.iterator(); iter.hasNext(); ) { try(Symbol symbol = iter.next()) { - scan = new Scan(symbol.getDataBytes(), symbol.getData()); + scan = new Scan(getRawBytes(symbol.getData()), symbol.getData()); } } return scan; @@ -122,5 +122,15 @@ public class ZBar { return false; } + private static byte[] getRawBytes(String str) { + char[] chars = str.toCharArray(); + byte[] bytes = new byte[chars.length]; + for(int i = 0; i < chars.length; i++) { + bytes[i] = (byte)(chars[i]); + } + + return bytes; + } + public record Scan(byte[] rawData, String stringData) {} }