How can I write a polish characters to a file on SD card?
I have something like this:
char user[] = "Michał";
File file = SD.open("aa.csv", FILE_WRITE);
file.println(user);
And in a file I've got: Michał.
How can I write a polish characters to a file on SD card?
I have something like this:
char user[] = "Michał";
File file = SD.open("aa.csv", FILE_WRITE);
file.println(user);
And in a file I've got: Michał.
I think the problem lies in the character set that the IDE applies to read/write the file. no sure it that can be changed...
What program are you trying to open the file with? What character set does it use? It should probably be UTF-8.
To make sure that the compiler uses UTF-8 as well, you can add
#pragma execution_character_set("utf-8")
at the top of your sketch, or add the u8
prefix to your string literals:
char user[] = u8"Michał";
Pieter