From 2b233936b084574e9076169bb4bdab45a1c5f801 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Thu, 28 Sep 2017 02:13:15 +0300 Subject: [PATCH] Add TINYGSM_UNICODE_TO_HEX --- TinyGsmCommon.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/TinyGsmCommon.h b/TinyGsmCommon.h index 234f47e..36c4f57 100644 --- a/TinyGsmCommon.h +++ b/TinyGsmCommon.h @@ -157,13 +157,18 @@ String TinyGsmDecodeHex16bit(String &instr) { buf[1] = instr[i+1]; char b = strtol(buf, NULL, 16); if (b) { // If high byte is non-zero, we can't handle it ;( - b = '?'; +#if defined(TINY_GSM_UNICODE_TO_HEX) + result += "\\x"; + result += instr.substring(i, i+4); +#else + result += "?"; +#endif } else { buf[0] = instr[i+2]; buf[1] = instr[i+3]; b = strtol(buf, NULL, 16); + result += b; } - result += b; } return result; }