Why - switching to Ã?

I do not understand when I save any line that contains - it changes to à ±. Even in the database, ñ changes to à ±.

Examples:

  • - becomes à ±.
  • Niño becomes Nià ± o.

I have no idea what causes this problem or where this problem comes from. Please help. Thanks in advance.

+7
source share
4 answers

Your string wrong encoding. This is UTF-8 , but do you need something else, Latin Latin? You need to decode.

Mark this

I hope he helps you.

+5
source

The character ñ (U + 00F1) is encoded using UTF-8 as two bytes 11000011 10110001 ( 0xC3 0xB1 ).

These two bytes are decoded using ISO 8859-1 as two ñ characters.

So, you most likely use UTF-8 to encode a character in bytes and ISO 8859-1 (Latin-1, as Simon assumed) to decode bytes as characters.

+9
source

Character encoding problems, of course. Make sure the database, web pages, content encoding, java files, string encoding, etc. Everyone uses the same encoding - for example, UTF-8.

+6
source

This is a character encoding problem, you need to check if your entire stack from writer to UTF-8 reader is installed.

Check out this discussion , it may contain some information that will help you:

+3
source

All Articles