Before we move on, I just want to clarify something, and that is, this URL encoding can get quite complex 😱.
It seems
on the face of it, it should be really simple.
The specs that govern URLs state that non-ASCII characters have to be URL encoded.
Simple enough, but then why does this happen? (swoosh sound)
You can see behind me I've got a very simple form. Nothing special. And all I want to do is grab some
Japanese text.
So I'm just on a random Japanese text website.
Let's get the English word
"hi".
There you go.
Let's copy this text.
Let's go back to our form, paste it in there.
What would you expect to happen if I click "submit"?
Well, as I just mentioned in the previous lecture, we would expect URL encoding to have to take place.
So in theory, we should not see these characters in the URL bar.
We should see a percentage symbol followed by two hex values, right?
Wrong ❌.
Look at that.
We see those Japanese symbols in the address bar itself.
Weird, right?
Well, it is weird, but don't panic.
That's exactly what I'm here for.
In upcoming lectures, we're going to be talking about why we see these, call-it, international characters
showing up in the URL address bar.
It really is fascinating.
And at first it's quite daunting, because there should just be one spec that governs URLs. That would
just make sense.
And of course that's not the case.
In reality, there are different organizations that always think they can do better than others, and
this results in a lot of confusion.
You know, even browsers themselves have to decide what to implement in the address bar.
What should they allow users to see?
It is weird.
It is confusing, but don't worry, because in the next few lectures I'm going to be shedding a lot of light
on how this all works. And by the end of it, you'll just be a better programmer.
You'll know exactly why those characters are showing up there, the way they do.
Anyway, adios 👋.
See you in the next lecture.