Skip to content

Commit 3ad688b

Browse files
Minimal fix for issue #961
1 parent 5423485 commit 3ad688b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/src/qrcode/QREncoder.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,12 @@ static const Version& RecommendVersion(ErrorCorrectionLevel ecLevel, CodecMode m
483483
EncodeResult Encode(const std::wstring& content, ErrorCorrectionLevel ecLevel, CharacterSet charset, int versionNumber,
484484
bool useGs1Format, int maskPattern)
485485
{
486-
bool charsetWasUnknown = charset == CharacterSet::Unknown;
487-
if (charsetWasUnknown) {
486+
if (charset == CharacterSet::Unknown) {
488487
charset = DEFAULT_BYTE_MODE_ENCODING;
489488
}
490489

490+
bool charsetIsDefault = (charset == DEFAULT_BYTE_MODE_ENCODING);
491+
491492
// Pick an encoding mode appropriate for the content. Note that this will not attempt to use
492493
// multiple modes / segments even if that were more efficient. Twould be nice.
493494
CodecMode mode = ChooseMode(content, charset);
@@ -497,7 +498,7 @@ EncodeResult Encode(const std::wstring& content, ErrorCorrectionLevel ecLevel, C
497498
BitArray headerBits;
498499

499500
// Append ECI segment if applicable
500-
if (mode == CodecMode::BYTE && !charsetWasUnknown) {
501+
if (mode == CodecMode::BYTE && !charsetIsDefault) {
501502
AppendECI(charset, headerBits);
502503
}
503504

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy