Write Latin characters to file (SPIFFS, LittleFS)
Posted: Thu Nov 18, 2021 6:07 pm
Hey guys,
I'm trying to write text to file but when there are special characters they look strange, example below:
On code "TESTING SPECIAL CHAR Ç É ção normal é e."
On file "TESTING SPECIAL CHAR Ç É ção normal é e."
Part of code bellow:
Both with String and with char[] the problem happens.
Interesting fact, if I use the arduinojson lib to serialize directly into the file the characters come out correctly.
this is driving me crazy...
Has anyone ever experienced this?
I'm trying to write text to file but when there are special characters they look strange, example below:
On code "TESTING SPECIAL CHAR Ç É ção normal é e."
On file "TESTING SPECIAL CHAR Ç É ção normal é e."
Part of code bellow:
Code: Select all
String bootout;
bool fsmount = LittleFS.begin();
if (fsmount) {
bootlog = true;
bootout = "TESTING SPECIAL CHAR Ç É ção normal é e.";
File f = LittleFS.open("bootlog.txt", "w");
if (f) {
f.println(bootout);
f.close();
}
}
Both with String and with char[] the problem happens.
Interesting fact, if I use the arduinojson lib to serialize directly into the file the characters come out correctly.
this is driving me crazy...
Has anyone ever experienced this?