Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. // here I'm getting an http request
  2. String payload = https.getString();
  3.  
  4. // checking the payload, it seems fine in console but I get some garbage characters when àèéùìò are printed
  5. Serial.println(payload);
  6.  
  7. // Length (with one extra character for the null terminator)
  8. int str_len = payload.length() + 1;
  9.  
  10. // Prepare the character array
  11. char xml[str_len];
  12.  
  13. // Copy it over
  14. payload.toCharArray(xml, str_len);
  15.  
  16. // there I'll parse xml with tinyxml2 but the MCU crashes before getting here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement