-1

I am working on a project that includes Turkish characters. But I can't use one of this chars in a if.

Example:

char myChar = 'ğ';
if(myChar == 'ğ'){
    //DO SOMETHING
}
gre_gor
  • 6,669
  • 9
  • 47
  • 52
bahoz99
  • 121
  • 1
  • 6

1 Answers1

1

A char variable can store 1 byte. Your Turkish character cannot be represented by a single byte. In UTF-8 encoding that's two bytes C4 9F.

use char myChar[] = "ğ"; or String myChar = "ğ";

Read https://playground.arduino.cc/Code/UTF-8/

Piglet
  • 27,501
  • 3
  • 20
  • 43