1

00:00:00,820  -->  00:00:03,370
Look a little bit of very short demo.

2

00:00:03,510  -->  00:00:10,110
The purpose of this demo is to show that when we are reading from a text file we need to use the same

3

00:00:10,110  -->  00:00:12,280
encoding scheme as the text file.

4

00:00:12,540  -->  00:00:18,120
Ok so the text file has certain encoding scheme which means that the text in the file has been anchored

5

00:00:18,150  -->  00:00:20,300
using that encoding scheme.

6

00:00:20,340  -->  00:00:24,100
Now when we are reading from that file we also need to use the same encoding scheme.

7

00:00:24,230  -->  00:00:26,800
OK otherwise it's not going to work correctly.

8

00:00:26,940  -->  00:00:29,670
So let's just go ahead and best that on this matter.

9

00:00:29,670  -->  00:00:35,700
New method is called as encoding sync which means that we want to keep the encoding schemes in sync

10

00:00:35,710  -->  00:00:36,040
.

11

00:00:36,480  -->  00:00:39,590
So here it's just a buffered reader and we are reading from this file.

12

00:00:39,620  -->  00:00:46,680
Karla's encoding are in the file this year and garding and it just has one line on only one character

13

00:00:46,680  -->  00:00:56,030
which is a euro and under-five itself is encoded using u d of 8 came here of eight.

14

00:00:56,040  -->  00:00:58,050
Now we will.

15

00:00:58,050  -->  00:01:01,730
And the encoding that we are specifying here is also Eudy of 8.

16

00:01:01,740  -->  00:01:07,140
So let's just run this and you can see that we have the Euro symbol which is fine.

17

00:01:07,170  -->  00:01:13,460
Now if we change this to let's say you have 16 big endian.

18

00:01:13,530  -->  00:01:14,950
Now if we run it.

19

00:01:15,450  -->  00:01:19,560
So it's not giving us the correct text.

20

00:01:19,670  -->  00:01:20,000
OK.

21

00:01:20,040  -->  00:01:21,210
So that's the problem.

22

00:01:21,330  -->  00:01:25,580
So we need to always read using the same kind of encoding scheme.

23

00:01:25,590  -->  00:01:30,140
Now let's just try the same thing in a slightly more fancier way.

24

00:01:31,260  -->  00:01:33,430
So here is the court.

25

00:01:34,320  -->  00:01:40,890
And here we are doing the same thing we are building a string and the string that we want to construct

26

00:01:40,890  -->  00:01:42,230
is a Euro symbol.

27

00:01:42,510  -->  00:01:47,640
And this particular string constructor it has two parameters one is a byte.

28

00:01:47,650  -->  00:01:49,620
Ari on the other one is the carter sec.

29

00:01:49,800  -->  00:01:53,990
Carter satiny 100 basically constructs a null string.

30

00:01:54,030  -->  00:01:58,380
Ok it's going to construct a null string by decoding the specified by Dhari.

31

00:01:58,410  -->  00:02:01,180
So we have this Bidar as a parameter.

32

00:02:01,260  -->  00:02:07,130
So it's going to be correct using the specified characters section and the baby are generating the bite

33

00:02:07,150  -->  00:02:08,280
array itself.

34

00:02:08,310  -->  00:02:14,100
And this way so you have the strength Eudo and we are in Wolken to get bytes metor on that string.

35

00:02:14,310  -->  00:02:18,800
And the goodbye to moderate returns the binary and uses this encoding scheme.

36

00:02:18,930  -->  00:02:25,350
OK so it's going to get better but that is going to encode this string using this character set it is

37

00:02:25,380  -->  00:02:28,450
going to return a sequence of match.

38

00:02:28,770  -->  00:02:36,150
And the string whether constructor is going to be coded using using the descriptor encoding scheme.

39

00:02:36,210  -->  00:02:39,030
So this is going to be called and this is actually encoding.

40

00:02:39,150  -->  00:02:41,060
So this is like reading from a fine.

41

00:02:41,340  -->  00:02:49,400
So if we do this or just run this so it gives the euro's human once again.

42

00:02:49,530  -->  00:02:49,980
Make it

43

00:02:54,390  -->  00:02:56,080
and it's not going to work.

44

00:02:56,100  -->  00:02:57,110
So that's the thing.

45

00:02:57,240  -->  00:03:02,730
And here is the same thing but we are using that kind of power.

46

00:03:03,020  -->  00:03:04,850
And this is us aski.

47

00:03:04,920  -->  00:03:08,630
Now this is Aski And if we see it prints it.

48

00:03:08,850  -->  00:03:14,020
And that's because you'll be of eight is backward compatible with us ascii.

49

00:03:14,020  -->  00:03:26,160
Now let's make it 16 b and this should not work because you have 16 of 16 is not backward compatible

50

00:03:26,160  -->  00:03:27,220
with US-ASCII.

51

00:03:27,260  -->  00:03:27,520
OK.

52

00:03:27,540  -->  00:03:30,050
Only UTF 8 is backward compatible.

53

00:03:30,240  -->  00:03:33,630
So just wanted to show these two things and that's it.

54

00:03:33,780  -->  00:03:34,160
Thank you
