SD Card and UTF8 encoding

Status
Not open for further replies.

webline

Member
Hi,

I'm using the PaulStoffregen/SD lib to read and write from a sd card on my teensy 3.6 board. Works fine.
What I don't get to work: read an write high ascii like german umlauts (öäü) to the card.

Is the lib compatible with UTF8? Any advice would be great (I didn't post my source code because it will not help I think - works fine, I just need a hint where to look for UTF-8 encoding).

Thanks,

Detlef
 
Played around a little bit more. The SD lib by Paul has no problems with UTF8 - my problems are related to the GSM 7-bit character encoding.
 
I figured out the the GSM module uses an 7-bit encoding - but still don't understand what's going on here.

If I passed a received char array containing "mit mehr öäü" from the GSM module to this simple method:

Code:
void printASCIICode(char * myString) {
  char currentChar;

  for(int i=0;i<strlen(myString);i++) {
    currentChar = myString[i];
    Serial.println(currentChar,HEX);
  }
}

I got this:
6D
69
74
20
6D
65
68
72
20
F6
E4
FC

Why do I get 0xf6, 0xe4 and 0xfc for the chars that should be ox7c,ox7b,ox7e?
If I pass "öäü" directly those character will be displayed in the serial monitor and the connected display. The character I enter in the code return the same hex value (f6,e4,fc) as the chars received by the GSM module - but those chars will only display "???"...

Any ideas to translate/decode those values so that I can display the high acsii chars?
 
Status
Not open for further replies.
Back
Top