Why do computers sometimes change special characters like “&” into “&” or “ ”

183 views

Why do computers sometimes change special characters like “&” into “&” or “ ”

In: 77

9 Answers

Anonymous 0 Comments

In HTML (the language used to make a website), & has a special meaning. It’s used to signal that you’re about to encode an unusual character (called an HTML entity) such as `‰` which turns into ‰. But what if you want to just show an & without it getting interpreted as having a special meaning? In that case, you need to encode it using & like this: `&` (for ampersand). When you’re writing text which is going to be converted to HTML, all special characters need to be converted into HTML entities in order to be displayed correctly. Unfortunately, sometimes this process happens twice in a row by mistake and you end up having the ampersand, that is there as proper HTML, being converted again. So you end up with & turning into `&` which turns into `&` resulting in what you see.

You are viewing 1 out of 9 answers, click here to view all answers.