- Home /
UTF-8 characters on Android build
Hello
As i was developing for Android i can't seem to retrieve correctly the format from the WWW request, In the editor it works fine, but as soon as i build to Android the UTF-8 characters are loaded as black diamonds question marks (wich i assume is an encoding error)
My www request code:
WWW questoes = new WWW("http://bentnail.com.br/extrair_perguntas.php", form);
yield return questoes;
string questoesString = System.Text.Encoding.Default.GetString(questoes.bytes);
arr_questoes = questoesString.Split(';');
And the in-game result
PC Editor version:
Android Version:
This is my last bug to finish the project, really need Pro help on this
Thanks!
Answer by airespt · Jan 17, 2017 at 11:41 AM
@maugustoclaudio Hi, maybe you solved this already but since it's still open, here goes.
Avoid using 'Encoding.Default' as this is platform dependant. If you are sure your php is sending UTF-8, try 'Encoding.UTF8'.
Another tip is, Instead of questoes.bytes you could try questoes.text as this should be string formatted if the WWW object was able to decode it.
Boa sorte amigo
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
XmlException: Text node cannot appear in this state 2 Answers
Binary Save on android issues 1 Answer
Android Data Directory 0 Answers