I know, we're covering very advanced things, and I hope you're following along. But you know what's...
weird, is that this doesn't really solve our problem 😥.
The page's encoding type is still ISO-8859-1.
This means that the theta value does not exist in that encoding type. But that does not stop the browser.
The browser will still try and store that theta sign in a way it understands and we've seen it does...
it, by storing it as a numeric character reference, in decimal form. That's key, in decimal form. And that...
is, 952. (alarm sound)
We've got a problem...
(sound: Houston, we have a problem)
What is the problem?
Server side code that processes GET and POST requests typically only understand URL encoded
strings.
They rarely understand numeric character references.
So in our example, theta is represented by the code point 952. But in Unicode
hex form, which is what servers typically want,
it's reference point would be 03B8.
And what does this mean?
This means that the servlet code that reads the name parameter of 952, it won't...
know that the 952 represents anything other than the number...
952.
How would it?
In other words, the real character of Theta won't be discovered by the servlet code unless you intentionally...
planned for the situation.
Does that make sense?
So the bottom line is that most servers will decode the string to get "θ".
It won't know that that "952" is a numeric character code for the browser.
It just won't know.
And this means the server is going to stop here, thinking that this represents the final characters that you...
are after, that the browser has needed.
Well, the solution is pretty straightforward and self-explanatory.
We should always select an encoding type for a form that can handle all the characters that we intend...
users to be able to write. I know...
it's a pretty obvious solution, right?
But it is what it is.
So if you expect to have multilingual users and hope to process multiple scripts, why don't we just...
use a character encoding that represents those scripts?
And utf-8, as we've discussed, is Unicode character encoding, that can correctly represent all characters...
in active use throughout the entire world 🌍.
And of course, we've seen that when we use utf-8 in the page instead of the ISO-8859-1...
the browser produces an entirely different URL, one that the server can understand. I hope...
this has made sense.
If you are still a bit confused, don't worry too much.
It really is...
you know, these are very advanced concepts and we're going to be discussing more of them throughout the course.
So, can't wait to see you in the next lecture.
Adios 👋.