From 4b63209076855718aef4e007d9393fc3b884e4e8 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 3 Oct 2022 21:31:27 -0500 Subject: [PATCH] correctly count unicde characters --- src/common/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/mod.rs b/src/common/mod.rs index c4cb972..79dfb64 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -2933,7 +2933,7 @@ impl ECIEncoderSet { let mut needUnicodeEncoder = priorityCharset.name().starts_with("UTF"); //Walk over the input string and see if all characters can be encoded with the list of encoders - for i in 0..stringToEncode.len() { + for i in 0..stringToEncode.chars().count() { // for (int i = 0; i < stringToEncode.length(); i++) { let mut canEncode = false; for encoder in &neededEncoders {