Decoding Mysql - Javascript

Asked

Viewed 46 times

0

Good afternoon, I have a database in MYSQL that returns processing information.

 ELSE
    IF(linhas_banco_in_p <> 0) THEN
        SET msg = 'ESSA CONTA E AGÊNCIA JÁ EXISTE NESSE BANCO, VERIFIQUE AS INFORMAÇÕES E TENTE NOVAMENTE';
        SELECT msg;
        ROLLBACK;
    ELSE

        INSERT INTO banco (
                nome_banco,

This message returns and is displayed via Javascript on the registration screen, within a modal. The problem is that the characters are coming this way:

inserir a descrição da imagem aqui

<meta charset="utf-8" />

I tried using charset='utf-8' function inside the Javascript tag, without success. How do I fix?

Thank you

  • What server side programming language you are using in your application?

1 answer

2

Basically it is a matter of saving your previous encoding in the right encoding, see in the options of your code editor (or DB utility) how to save as UTF-8 (or the encoding you will use on your page and mainly compatible with the DB table).

An alternative (less noble in this case, not global solution) is to use entities (but check the compatibility with the HTML standard used):

SET msg = 'ESSA CONTA E AG&Ecirc;NCIA J&Aacute; EXISTEM NESSE BANCO,
           VERIFIQUE AS INFORMA&Ccedil;&Otilde;ES E TENTE NOVAMENTE'


If you have any more problems on the PHP and Mysql side, probably the solution is here:

Doubt with charset=iso-8859-1 and utf8


And if you’re using a specific code editor...

as Sublime Text, for example, the solution is here:

Sublime Text 2 - Encoding UTF-8 does not work

To Netbeans:

Netbeans Messing Up Accent

For other editors it is always the same logic. When saving, choose the correct encoding.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.