mirror of https://github.com/status-im/qzxing.git
@BarcodeEncoder: translate the URL persentage encoded special character to the corresponding UTF8 code before encoding to QR Code. #134
This commit is contained in:
parent
1082c3b9e5
commit
c1f4379ec7
|
@ -31,11 +31,19 @@ ApplicationWindow {
|
|||
fill: parent
|
||||
margins: 10
|
||||
}
|
||||
TextField {
|
||||
|
||||
TextArea {
|
||||
id: inputField
|
||||
Layout.fillWidth: true
|
||||
selectByMouse: true
|
||||
text: "Hello world!"
|
||||
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
border.color: "#656565"
|
||||
border.width: 1
|
||||
color: "transparent"
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
|
|
|
@ -595,13 +595,15 @@ QImage QZXing::encodeData(const QString &data, const QZXingEncoderConfig &encode
|
|||
{
|
||||
QImage image;
|
||||
|
||||
QString dataTemp(QUrl::fromPercentEncoding(data.toUtf8()));
|
||||
|
||||
try {
|
||||
switch (encoderConfig.format) {
|
||||
#ifdef ENABLE_ENCODER_QR_CODE
|
||||
case EncoderFormat_QR_CODE:
|
||||
{
|
||||
Ref<qrcode::QRCode> barcode = qrcode::Encoder::encode(
|
||||
data.toStdWString(),
|
||||
dataTemp.toStdWString(),
|
||||
encoderConfig.errorCorrectionLevel == EncodeErrorCorrectionLevel_H ?
|
||||
qrcode::ErrorCorrectionLevel::H :
|
||||
(encoderConfig.errorCorrectionLevel == EncodeErrorCorrectionLevel_Q ?
|
||||
|
|
|
@ -87,8 +87,6 @@ Ref<QRCode> Encoder::encode(const std::wstring& content, ErrorCorrectionLevel &e
|
|||
version = recommendVersion(ecLevel, mode, headerBits, dataBits);
|
||||
}
|
||||
|
||||
qDebug() << version->getVersionNumber() << ": " << content.size();
|
||||
|
||||
BitArray headerAndDataBits;
|
||||
headerAndDataBits.appendBitArray(headerBits);
|
||||
// Find "length" of main segment and write it
|
||||
|
|
Loading…
Reference in New Issue