1
votes

As far as I know - base 64 can represent any char. ( inclduing binary)

Base64 encoding schemes are commonly used when there is a need to encode binary(!) data that need to be stored and transferred over media that are designed to deal with textual data

So I tried to apply it on extended ascii char ( beyond the 127)

the char :

enter image description here

after following the simple algorithm :

I got to :

enter image description here

so the value should be Fy

So why when I use online-encoder and put the value by alt+178 ,

enter image description here

I get this result :

enter image description here

What is going on here ?

3
I would guess the character is being encoded in UTF8 first, which will produce two bytes before base-64 encoding starts.Damien_The_Unbeliever
@Damien_The_Unbeliever yeah , thanks I wrote the result if you want to see...Royi Namir
base 64 can represent any byte. Your confusion is in getting from a char to byte(s) before the Base64.Henk Holterman
@HenkHolterman Hi. the thing which I dont understand : byte can represent any value from 0-255. and the 178 is between this interval. so he actually needs 1 byte. why still he represent him as 3 bytes ? just because .net chr is unicode ? even so - according to msdn : msdn.microsoft.com/en-us/library/7sx7t66b(v=vs.100).aspx it says that it uses 2 bytes. so why vs shows me 3 bytes ?Royi Namir
In memory, all chars are Unicode and 16 bits. The fun starts when Text is streamed. You always need an Encoding. With ANSI it will be 1 byte, with UTF8 a char can be 1-3 bytes.Henk Holterman

3 Answers

2
votes

Your browser sent the encoding website the UTF-8 encoding of the character. This encoding is not 178.

2
votes

That is the UTF-8 encoding of unicode character U+2593, which is the same as extended ASCII character 178.

U+2593

0
votes

Thanks to Damien_The_Unbeliever && zmbq &&Markus Jarderot :

enter image description here

so

enter image description here