Questions tagged [text-decoding]
25 questions
3
votes
3 answers
Read NUL-terminated String from ByteBuffer
How can I read NUL-terminated UTF-8 string from Java ByteBuffer starting at ByteBuffer#position()?
ByteBuffer b = /* 61 62 63 64 00 31 32 34 00 (hex) */;
String s0 = /* read first string */;
String s1 = /* read second string */;
// `s0` will now…

jiwopene
- 3,077
- 17
- 30
3
votes
0 answers
Decoding problem with fitz.Document in Python 3.7
I want to extract the text of a PDF and use some regular expressions to filter for information.
I am coding in Python 3.7.4 using fitz for parsing the pdf. The PDF is written in German. My code looks as follows:
doc = fitz.open(pdfpath)
pagecount =…

Riprip
- 41
- 1
- 4
2
votes
1 answer
Greek and special characters show as mojibake - how to decode?
I'm trying to figure out how to decode some corrupt characters I have in a spreadsheet. There is a list of website titles: some in English, some in Greek, some in other languages. For example, Greek phrase ΕΛΛΗΝΙΚΑ ΝΕΑ ΤΩΡΑ shows as ŒïŒõŒõŒóŒùŒôŒöŒë…

pgndck
- 23
- 3
2
votes
0 answers
Problems with TextDecoder decoding Uint8Array
Having problems with TextDecoder decoding Uint8Array. (background info)
var staring = "hello";
var array = new Uint8Array(2);
array[0]=255;
array[1]=0;
var binary=(new TextDecoder("utf-8")).decode(array)
console.log(binary);
Should give me:…

n0sr3v
- 21
- 3
2
votes
1 answer
Remove special characters from text/PDF with Apache Tika
I am parsing PDF file to extract text with Apache Tika.
//Create a body content handler
BodyContentHandler handler = new BodyContentHandler();
//Metadata
Metadata metadata = new Metadata();
//Input file path
FileInputStream inputstream = new…

Tariq
- 2,274
- 4
- 24
- 40
2
votes
3 answers
boost::iostreams::zlib::default_noheader seems to be ignored
I'm having trouble getting boost::iostreams's zlib filter to ignore gzip headers ... It seems that setting zlib_param's default_noheader to true and then calling zlib_decompressor() produces the 'data_error' error (incorrect header check). This…

Will
- 92
- 1
- 7
1
vote
0 answers
Decoding data from WIN10 ssh server (response of paramiko recv())
I am using paramiko to connect to a win10 server (client is Linux) and for most parts communication is OK.
But when i read the response to a command (via recv()) , i see some strange data.
Example: this is the response to "hostname" and it should…

psb
- 67
- 1
- 6
1
vote
1 answer
Unable to decode сyrillic text with Java
I have the following text:
Анна Меркулова
With help of the following online decoder https://2cyr.com/decode/?lang=en I was able to decode mentioned string to the correct one:
Анна Меркулова
Source encoding is UTF-8 and the target is…

alexanoid
- 24,051
- 54
- 210
- 410
1
vote
1 answer
A file named Butterfly7198.txt was found and It's boggling me
I happened to come across a file while changing images for a Toontown Rewritten's Context Pack I've been working on and I stumbled across this file marked
Butterfly7198.txt
and upon clicking on it, I was greeted with the following prompt that…

ObeastPepsiMan
- 19
- 2
1
vote
1 answer
TextDecoder failing in ES6 Promise recursion
I'm attempting to query an API which responds with a ReadableStream of XML.
The code below uses a recursive Promise. Recursive because it sometimes doesn't decode the stream in a singular iteration and this is whats causing my headache.
While I'm…

Ben
- 315
- 4
- 19
1
vote
1 answer
How can I obtain timing values from the output of nvprof or of NVidia Visual Profiler?
I'm using nvprof to profile something (which includes both CPU work and GPU work, i.e. I use nvprof markers etc.), and I get binary files which nvprof produces. I can import these into NVVP (NVidia Visual Profiler; Linux version), and with a little…

einpoklum
- 118,144
- 57
- 340
- 684
1
vote
2 answers
Text Decoding Problem
So given this input string:
=?ISO-8859-1?Q?TEST=2C_This_Is_A_Test_of_Some_Encoding=AE?=
And this function:
private string DecodeSubject(string input)
{
StringBuilder sb = new StringBuilder();
MatchCollection matches…

Jason Miesionczek
- 14,268
- 17
- 76
- 108
0
votes
0 answers
Cannot find what is the encoding of the signature obtained by signing with private key
I create a pair of ed25519 keys and then used the cryptography Python library to sign an auth code with the private key:
private_key = serialization.load_ssh_private_key(open('ed25519', 'rb').read(), b'123456', default_backend())
with…

Sarthak Rastogi
- 31
- 3
0
votes
1 answer
Get Out of a TextDecoderStream() from NodeJS
When I send an error message from my express nodejs app using res.status(400).send(err.stack);, I cannot seem to get out of the decoder stream I setup on the receiving end.
Here is my code in the browser (limited to the fetch…

Chapo
- 2,563
- 3
- 30
- 60
0
votes
0 answers
Fetching and decoding non-utf8 data (reactjs)
I have a react native project, in which I am trying to fetch an html page and parse it, in order to display some of its content.
I originally performed the request with react's fetch api. However, the page that I got was encoded using the ISO-8859-7…

O8eiosSam
- 78
- 1
- 9