French character in app using String


#1

Hi,

I have an issue trying to display french character in app using drawText(). My function is something like

String note()
{
String s = “ré”;
return s + “#”;
}

but it shows me “rÃⒸ#”. I’m sure there’s a simple solution, thanks in advance !


#2

Does it work if you use the escape sequence?

String note()
{
    String s = "r\u00E9";
    return s + "#";
}

#4

Yes it works perfectly, thanks a lot !


#5

Oups sorry I forgot I changed my drawText(note(), …) by drawText(“ré”, …) to find out wich function was causing the problem… no it’s not working with “r\u00E9” :frowning:


#6

I don’t know if that will work, but you can try:

  • "r\xc3\xa9"
  • u8"r\xc3\xa9"

#7

in Projucer : menu “Tools”-> “UTF-8 String-Literal Helper”


#8

That’s pretty covenient, and works like a charm, thank you !