diff --git a/core/src/WriteBarcode.cpp b/core/src/WriteBarcode.cpp index edbca52994..e39f4412d3 100644 --- a/core/src/WriteBarcode.cpp +++ b/core/src/WriteBarcode.cpp @@ -350,6 +350,7 @@ Barcode CreateBarcodeFromText(std::string_view contents, const CreatorOptions& o auto writer = MultiFormatWriter(opts.format()).setMargin(0); if (!opts.ecLevel().empty()) writer.setEccLevel(std::stoi(opts.ecLevel())); + writer.setEncoding(CharacterSet::UTF8); // write UTF8 (ECI value 26) for maximum compatibility return CreateBarcode(writer.encode(std::string(contents), 0, IsLinearCode(opts.format()) ? 50 : 0), opts); }