Skip to content

Commit

Permalink
WriteBarcode: generate UTF8 with MultiFormatWriter backend of exp. API
Browse files Browse the repository at this point in the history
See also #819.
  • Loading branch information
axxel committed Sep 2, 2024
1 parent afcbd51 commit 8d9d569
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/src/WriteBarcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8d9d569

Please sign in to comment.