Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #35204
| From | Jupi Krem <nomail@gmail.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Base64 encode using using windows-1250 encoding |
| Date | 2018-06-09 10:25 +0200 |
| Organization | Iskon Internet d.d. |
| Message-ID | <pfg2ut$6ff$1@sunce.iskon.hr> (permalink) |
| References | (1 earlier) <3469849.XUi3uDslzQ@PointedEars.de> <pffn0r$t08$1@sunce.iskon.hr> <16824345.heBUIXtyyW@PointedEars.de> <pfg10q$512$1@sunce.iskon.hr> <3623877.9AgGOrEZyW@PointedEars.de> |
[Multipart message — attachments visible in raw view] - view raw
It happens that Thomas 'PointedEars' Lahn formulated :
> Jupi Krem wrote:
>
>> Thomas 'PointedEars' Lahn has brought this to us :
>>> Jupi wrote:
>>>> Thomas 'PointedEars' Lahn expressed precisely :
>>>>>> I need to encode string using Central European Windows-1250 encoding.
>>>>> Why?
>>>> Because I need it.
>>> No, you just *think* you need it.
>>
>> Right. I need just solution for my problem.
>
> This is not a support forum for Copy & Pray.
>
OK I understand. I will try to explain my problem.
>>> <http://xyproblem.info/>
>
> Have you even read this?
Yes, I see your point.
>>>> I just need to encode some string which
>>>> contains Easteuropean characters to base64 string.
>>>
>>> var b64 = window.btoa("Perišić");
>>
>> Result is this:
>> UGVyacWhacSH
>
> In which environment? See my update.
>
>> and I need this:
>> UGVyaZpp5g==
>
> Hardly:
>
>>> window.atob("UGVyaZpp5g==")
>> "Periiæ"
Yes, it means atob is not good option.
>> […]
>>>> Curently, when I encode string, it is encoded using utf-8.
>>> No, it is not.
>>>
>>> How did you get the idea that it would be?
>> Please check here: http://base64encodedecode.com
>
> That is a Web application. If you are asking here, you are asking to do it
> in your own code instead.
>
>> you can select different Encoding.
>
> So that is _not_ what I said.
>
> Because of the limitations of Base64, they are basically using the same
> workaround as I did in my update. For example,
>
> ć
>
> is encoded as
>
> xIc=
>
> as it is with
>
>>> window.btoa(encodeURIComponent("ć").replace(/%([0-9A-F]{2})/g, (m, code)
>> => String.fromCharCode(parseInt(code, 16))))
>> "xIc="
I agree but ć must be encoded as 5g== and not as xIc=
please check attached image.
> (Our inputs and outputs match; their code is minified, so I will not bother
> to check further.)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Base64 encode using using windows-1250 encoding Jupi <nomail@gmail.com> - 2018-06-08 16:21 +0200
Re: Base64 encode using using windows-1250 encoding Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-06-08 20:26 +0200
Re: Base64 encode using using windows-1250 encoding Jupi <nomail@gmail.com> - 2018-06-08 22:09 +0200
Re: Base64 encode using using windows-1250 encoding Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-06-08 22:57 +0200
Re: Base64 encode using using windows-1250 encoding Jupi <nomail@gmail.com> - 2018-06-09 07:02 +0200
Re: Base64 encode using using windows-1250 encoding Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-06-09 09:25 +0200
Re: Base64 encode using using windows-1250 encoding Jupi Krem <nomail@gmail.com> - 2018-06-09 09:52 +0200
Re: Base64 encode using using windows-1250 encoding Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-06-09 10:12 +0200
Re: Base64 encode using using windows-1250 encoding Jupi Krem <nomail@gmail.com> - 2018-06-09 10:25 +0200
Re: Base64 encode using using windows-1250 encoding Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-06-09 09:53 +0200
Re: Base64 encode using using windows-1250 encoding Jupi Krem <nomail@gmail.com> - 2018-06-09 10:01 +0200
Re: Base64 encode using using windows-1250 encoding Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-06-09 10:17 +0200
Re: Base64 encode using using windows-1250 encoding Jupi Krem <nomail@gmail.com> - 2018-06-09 10:32 +0200
Re: Base64 encode using using windows-1250 encoding Jupi Krem <nomail@gmail.com> - 2018-06-09 10:02 +0200
Re: Base64 encode using using windows-1250 encoding Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-06-09 10:20 +0200
Re: Base64 encode using using windows-1250 encoding Jupi Krem <nomail@gmail.com> - 2018-06-09 10:29 +0200
Re: Base64 encode using using windows-1250 encoding Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-06-09 12:07 +0200
Re: Base64 encode using using windows-1250 encoding "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-06-09 09:30 +0200
Re: Base64 encode using using windows-1250 encoding Jupi Krem <nomail@gmail.com> - 2018-06-09 09:55 +0200
Re: Base64 encode using using windows-1250 encoding "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-06-09 13:11 +0200
Re: Base64 encode using using windows-1250 encoding Frank Kozuschnik <franko@nurfuerspam.de> - 2018-06-09 12:45 +0200
Re: Base64 encode using using windows-1250 encoding Jupi Krem <nomail@gmail.com> - 2018-06-09 13:13 +0200
Re: Base64 encode using using windows-1250 encoding Mickey Finn <mfinn@gmail.com> - 2018-06-14 19:22 -0300
Re: Base64 encode using using windows-1250 encoding "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-06-09 12:30 +0200
Re: Base64 encode using using windows-1250 encoding Jupi Krem <nomail@gmail.com> - 2018-06-09 13:14 +0200
Re: Base64 encode using using windows-1250 encoding Yappi <nomail@gmail.com> - 2018-06-09 13:33 +0200
csiph-web