French character in app using String


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 !

Does it work if you use the escape sequence?

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

Yes it works perfectly, thanks a lot !

1 Like

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:

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

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

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


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