Похожие чаты

Hey hey, guys! I'm stuck with a problem. Maybe, you

can help me with it as I couldn't find a solution in google/stackoverflow.
I have a percent-encoded binary data from PHP (urlencode function is used ). And I want to decode it and get a string (of bytes) which I need to pass to a spefical function and save to a file. I try using String.fromCharCode( parseInt(hex, 16)) to decode a hex value to a byte. The problem is with values which is not ASCII (> 0x7F). JS converts it somehow.
Example: for %E9, String.fromCharCode( parseInt("E9", 16)) returns actually 0xC3 0xA9(it's what i see when i save the string to a file), instead of 0xE9.
So, is it possible to archive what i need with pure JS? And how?
I should mention that I work in a very spefic environment. It's node.js, but i cannot use a lot of things like Buffers. So it's more like js in browser

1 ответов

9 просмотров

https://stackoverflow.com/questions/11815883/convert-non-ascii-characters-umlauts-accents-to-their-closest-ascii-equiva Maybe this would help out?

Похожие вопросы

Обсуждают сегодня

Anyone here suffers from unexplained aural migraines, who would be up for talking for a bit? Doesn't *have* to be aural, but I am not asking about headaches, I mean actual mi...
Martin Rys
55
Вопрос. Теоретический. Есть список команд. Команды отправляю в обработку некой функции, по очереди. Разные команды могут давать разные результаты после обработки. В зависимос...
Serjone
7
Привет, нужен совет старших товарищей. Есть глобальная переменная var DefaultDataFolder:string; инициализируем DefaultDataFolder:='a:\_OUT\'; есть примитивная процедур...
Max Otto
10
We heading to 1.1$ 🤔?
CryptoBo$$
35
A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
46
Всем вечера. Подскажите как лучше сделать. делаю на Д10 Например будет база данных на SQLite. в ней будет много таблиц. более 50шт Типа справочник. Содержать ID Name Id p...
Андрей Т 🐎
10
Сonst magicTgHTML = (text, entities) => { let processedText = text; let offsetShift = 0; entities.forEach(entity => { const { offset, length, type, url, ...
Андрей
1
А если для werf организовать отдельный репозиторий, а сервисы из проекта подключить как симлинки? И симлинки в гитигнор добавить?
Dmitriy Andreev
13
Ideally, when we launch a game from a particular studio, that studio should have the right to access the uniqs from their game on our wallet. For example, if you die in a Ubis...
Lisandru
16
это группа токсиков или тех кто помогает?
Ибрагим
9
Карта сайта