WEBVTT

0
00:00.170 --> 00:08.720
Before we move on, I just want to clarify something, and that is, this URL encoding can get quite complex 😱.

1
00:08.990 --> 00:09.740
It seems

2
00:09.740 --> 00:11.710
on the face of it, it should be really simple.

3
00:11.720 --> 00:17.760
The specs that govern URLs state that non-ASCII characters have to be URL encoded.

4
00:17.780 --> 00:21.080
Simple enough, but then why does this happen?
(swoosh sound)

5
00:21.260 --> 00:27.890
You can see behind me I've got a very simple form. Nothing special. And all I want to do is grab some

6
00:27.890 --> 00:29.030
Japanese text.

7
00:29.030 --> 00:32.390
So I'm just on a random Japanese text website.

8
00:32.510 --> 00:33.650
Let's get the English word

9
00:33.650 --> 00:34.190
"hi".

10
00:34.970 --> 00:35.540
There you go.

11
00:35.570 --> 00:36.980
Let's copy this text.

12
00:38.050 --> 00:40.240
Let's go back to our form, paste it in there.

13
00:40.270 --> 00:42.760
What would you expect to happen if I click "submit"?

14
00:43.530 --> 00:48.300
Well, as I just mentioned in the previous lecture, we would expect URL encoding to have to take place.

15
00:48.300 --> 00:51.810
So in theory, we should not see these characters in the URL bar.

16
00:51.810 --> 00:56.460
We should see a percentage symbol followed by two hex values, right?

17
00:59.120 --> 00:59.690
Wrong ❌.

18
01:01.070 --> 01:01.820
Look at that.

19
01:01.850 --> 01:05.780
We see those Japanese symbols in the address bar itself.

20
01:05.810 --> 01:06.800
Weird, right?

21
01:07.040 --> 01:09.590
Well, it is weird, but don't panic.

22
01:09.620 --> 01:11.840
That's exactly what I'm here for.

23
01:11.870 --> 01:17.030
In upcoming lectures, we're going to be talking about why we see these, call-it, international characters

24
01:17.030 --> 01:19.130
showing up in the URL address bar.

25
01:19.340 --> 01:20.510
It really is fascinating.

26
01:20.510 --> 01:27.380
And at first it's quite daunting, because there should just be one spec that governs URLs. That would

27
01:27.380 --> 01:28.460
just make sense.

28
01:28.460 --> 01:29.870
And of course that's not the case.

29
01:29.870 --> 01:35.240
In reality, there are different organizations that always think they can do better than others, and

30
01:35.240 --> 01:36.950
this results in a lot of confusion.

31
01:36.950 --> 01:42.080
You know, even browsers themselves have to decide what to implement in the address bar.

32
01:42.080 --> 01:44.660
What should they allow users to see?

33
01:44.660 --> 01:45.680
It is weird.

34
01:45.680 --> 01:50.270
It is confusing, but don't worry, because in the next few lectures I'm going to be shedding a lot of light

35
01:50.270 --> 01:55.580
on how this all works. And by the end of it, you'll just be a better programmer.

36
01:55.580 --> 01:59.670
You'll know exactly why those characters are showing up there, the way they do.

37
01:59.700 --> 02:00.960
Anyway, adios 👋.

38
02:00.990 --> 02:02.490
See you in the next lecture.