problems with accentuation

Hello, I am Brazilian, in our language (Portuguese) use many accent (,, ~, ^, á, é, ã,).
I’m trying to send a word with the accent for arduino by bluetooth and it returns me the serial monitor the wrong word.
example:
I send (você).
and returns me (vocÃe).
how to solve this problem or how to eliminate this accent, returning me the word without the accent (voce).

It looks like the character you are sending for the accented e character is being sent as a double byte character because the system doesn't think it can be represent in single byte ASCII

You could see if there is a ASCII single byte character that looks the same and use an escape code instead.

When you say that you are sending via Bluetooth, is this sending to a serial monitor and if so, which serial monitor eg on Android

Are you using signed chars or unsigned chars? Though I suspect that rogerClark is on the right track.

There's a similar "conundrum" with Esperanto. The “X” method of representing the Esperanto alphabet. http://esperanto.org/stanford/prononc/

I’m sending the word (você) via bluetooth for android app (Android Meets Robots: Voice) from my phone when I talk on the phone app the word (you) the word is sent to the arduino when I print the plavra that received the word in the serial monitor (vocÃe) appears.
the serial monitor is the sketch programming arduino own.

Example:
char string1[7]; //string com o tamanho de 7
int i=0; //declara i igual a zero

void setup(){ //configuração
Serial.begin(9600); //velocidade da serial
Serial.flush(); //Limpa a serial para evitar “lixo” na tela
delayMicroseconds(100); // atraso para confirmação de limpeza na serial
}

void loop(){ //inicio do loop
if(Serial.available()>0){ //verifica se chegou alguma informação
for( i=0;i<6;i++){ //incrementa i ate 6
delay(1); //1 mile segundo
string1*= Serial.read(); //guanda o caracter na posição de acordo com o valor de i*

  • delay(1); //1 mele segundo*

  • }*

  • string1[++i]=’\0’; //posição 8 igual a ‘\0’*

  • Serial.println(string1);*
    }
    }

What appears to be happening is the accented character at the end of você

Is being sent by the Android device as 2 bytes instead of 1 byte.

If you take a look at those characters in a text editor / Hex viewer like Notedpad++ you will see that if you pase

você

as the text and view the hex it displays this

76 6f 63 c3 aa

So it appears that the last character is not available in standard ascii (see http://www.asciitable.com/ )

Strangely the character looks like the one at decimal 136, which may work via the normal Arduino serial terminal, but the other one won't

I've always viewed the Serial terminal in the Arduino as a debugging tool and not a system for presenting data.

You could try to look for another terminal program that is capable of reconstructing these double byte chars, but I've no idea how you'd do this yourself There may be some standard where systems know that if the char is C3 then its a double byte character but I don't know of one.

Its probably better to fix this at the Android end, and either send every character as double byte ( and write some code on the Arduino to translate this back to single byte chars), or make sure the Arduino only sends single byte chars.

Just a thought, but you could possible do a hack like this

void decodeAndPrintString(char *c)
{
    while(*c)
    {
        if (*c!=0xc3)
        {
        Serial.pint(c);
        }
        else
        {
                c++; // presumes not end of string !!!!!
                switch(c)
                {
                case 0xaa:
                    Serial.print(136);// Code for char 0xC3 0xAA
                    break;
            }
        }
        c++;
    }

}

If you have a lot of codes to process, you'd be better off building some sort of lookup table PS. I've not tested this code, it may not compile. and I didnt put in any error checking