Split long text constants in demo programs.
This commit is contained in:
parent
667c744d8b
commit
dd47ef10c7
|
@ -89,7 +89,8 @@ static void doVarietyDemo(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // Unicode text as UTF-8
|
{ // Unicode text as UTF-8
|
||||||
const char *text = "\xE3\x81\x93\xE3\x82\x93\xE3\x81\xAB\xE3\x81\xA1wa\xE3\x80\x81\xE4\xB8\x96\xE7\x95\x8C\xEF\xBC\x81\x20\xCE\xB1\xCE\xB2\xCE\xB3\xCE\xB4";
|
const char *text = "\xE3\x81\x93\xE3\x82\x93\xE3\x81\xAB\xE3\x81\xA1wa\xE3\x80\x81"
|
||||||
|
"\xE4\xB8\x96\xE7\x95\x8C\xEF\xBC\x81\x20\xCE\xB1\xCE\xB2\xCE\xB3\xCE\xB4";
|
||||||
uint8_t qrcode[qrcodegen_BUFFER_LEN_MAX];
|
uint8_t qrcode[qrcodegen_BUFFER_LEN_MAX];
|
||||||
uint8_t tempBuffer[qrcodegen_BUFFER_LEN_MAX];
|
uint8_t tempBuffer[qrcodegen_BUFFER_LEN_MAX];
|
||||||
bool ok = qrcodegen_encodeText(text, tempBuffer, qrcode,
|
bool ok = qrcodegen_encodeText(text, tempBuffer, qrcode,
|
||||||
|
|
|
@ -82,7 +82,8 @@ static void doVarietyDemo() {
|
||||||
printQr(qr1);
|
printQr(qr1);
|
||||||
|
|
||||||
// Unicode text as UTF-8
|
// Unicode text as UTF-8
|
||||||
const QrCode qr2 = QrCode::encodeText("\xE3\x81\x93\xE3\x82\x93\xE3\x81\xAB\xE3\x81\xA1wa\xE3\x80\x81\xE4\xB8\x96\xE7\x95\x8C\xEF\xBC\x81\x20\xCE\xB1\xCE\xB2\xCE\xB3\xCE\xB4", QrCode::Ecc::QUARTILE);
|
const QrCode qr2 = QrCode::encodeText("\xE3\x81\x93\xE3\x82\x93\xE3\x81\xAB\xE3\x81\xA1wa\xE3\x80\x81"
|
||||||
|
"\xE4\xB8\x96\xE7\x95\x8C\xEF\xBC\x81\x20\xCE\xB1\xCE\xB2\xCE\xB3\xCE\xB4", QrCode::Ecc::QUARTILE);
|
||||||
printQr(qr2);
|
printQr(qr2);
|
||||||
|
|
||||||
// Moderately large QR Code using longer text (from Lewis Carroll's Alice in Wonderland)
|
// Moderately large QR Code using longer text (from Lewis Carroll's Alice in Wonderland)
|
||||||
|
|
Loading…
Reference in New Issue