Questions tagged [encode]

to convert some data (e.g. string, picture) to some representation (e.g. bytes, electrical signals)

0
votes
0answers
15 views

How to decode bytes object that contains invalid bytes, Python3

In python2, I can produce these hex bytes represented in a string format all day '\x00\xaa\xff' >>>’00'.decode('hex') + 'aa'.decode('hex') + 'ff'.decode('hex') >>>'\x00\xaa\xff' ...
0
votes
1answer
25 views

Need to encode audio byte[] as string to be transferred via JSON. Will be encoded and sent from C# and read as audio bytes in Java

So I have found many similar questions and what it seems to come down to is difference in opinion on what encoding format you use. I have tried both Base64 and UTF-8. When I used Base64, the bytes ...
0
votes
1answer
46 views

Stop getting values from arduino after some time

I have a strange problem, I have Arduino UNO/MEGA and I need to get Gyro sensors's data and I want to see the data in the serial monitor. Seems like a simple task, I wrote a simple C program which ...
1
vote
1answer
34 views

Animated WebP enecoder for Android

Are there any examples on how to encode animated WebP for Android, or maybe someone was successful and can guide me through it? I have a batch of webP images, and I want to create an animated one ...
-1
votes
1answer
18 views

builtins.TypeError: cannot convert 'method' object to bytes [on hold]

I am getting "builtins.TypeError: cannot convert 'method' object to bytes" while trying to decode bson data which I have encoded just before. I would like to get the decoded data into a dict for each ...
0
votes
0answers
5 views

Incorrect display due to encode probem with googleVis function

I'am trying to use the googleViz package to plot a Sankey Diagram. But The encode is not right and the output doesn't display the right encode. I coulnd't find a solution. I saw this question, but it ...
0
votes
1answer
18 views

base64.encodestring returns error Unicode objects must be encoded before hashing

I am using the following code which works fine on python2.7. This code returns me error 'Unicode objects must be encoded before hashing' on python 3.7. Can someone please tell me the equal of this in ...
-4
votes
1answer
35 views

i need help to decode this code javascript code [closed]

how can i decode this code !? .. i don't need this code .. its just an example , i just want to know how can i decode it . var _0x2a14=["\x7B","\x73\x70\x6C\x69\x74","\x6C\x65\x6E\x67\x74\x68\x7B\...
0
votes
2answers
44 views

UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-31: ordinal not in range(128)

I'm currently studying web scraping, this is just for test! I have no idea why this error arose, would you look at the code what I did wrongly and help me to solve the issues? from urllib.request ...
-1
votes
1answer
42 views

How do I get files from zipped folder and encode and save them to database without extracting the files?

Server has almost 50 GBs of zipped files. I need a best approach to extract files from these zipped folder and base 64 encode them and saved them into Database as blob. I wish not to extract the whole ...
0
votes
1answer
36 views

spark.sparkContext.textFile read a file using UTF-8 encoding

I am trying to read a file using spark.sparkContext.textFile. The file is in unicode encoded. when I read the file some of the chars are as below: 2851 K�RNYE HUNGARY 2851 K�RNYE HUNGARY how ...
1
vote
1answer
40 views

How to convert a string from unicode to html entity

I'm trying to convert an Arabic string like this: ص to this: ص Is there a way (or package) to do it in Go?
0
votes
2answers
30 views

encoding decoding string in python 3.6 doesn't work?

I have this code: import base64 words = ('word1',"word2") for word in words: #for loop str_encoded = base64.b64encode(word.encode()) # encoding it print(str_encoded) #print encoded ...
-1
votes
1answer
20 views

Why Does Url Decode a Backslash into 2 Backslashes

I am trying to decode a url encoding. However, during testing I saw that the encoding of a backslash \ which is %5C will get decoded into \\. Why is that? How can I make it just one backslash without ...
0
votes
0answers
17 views

Ext.json.encode converts hex value of a character into its original character

I am getting a java script object from a text field in form (I wrote & inside it) as var obj={"name":"%26","salary":45124}; here %26 represents "&"(hex value) (I don't know why it converted ...
-1
votes
1answer
16 views

encode method python 3

I'm converting an application from Ruby to Python, in Ruby, there is a force_encoding method used to encode the utf8 string. Now, in Python there is no exact match for force_encoding so, I'm using ...
0
votes
1answer
19 views

How to encode GZipEncoder.class coded JSON reponse

I have a service which is being encoded with GZipEncoder.class in java restful services. Now, when I'm trying to hit and get the response. I'm getting encoded response as ���*O���4�=��鯒c[F�S��. Can ...
0
votes
1answer
25 views

Generating Oauth authorization token using base64 encoding

I am trying to follow the guide to generate Oauth authentication tokens for YAHOO DSP API. Base64 encoding is a way of encoding binary data into text so that it can be easily transmitted across a ...
-1
votes
0answers
28 views

How to return actual charecter instead of Byte string in Decoding in python?

When I decode the string with base64 I'm getting byte string not Unicode The string passed is vuv6kZgweA2YqSU4vMOuYStrbwZayDYaL7UQ+JajFCVc2p4HW1o68OmIm2l3Rbi/IaCWtKD5m6an7LqnvwRYVA== And output is ...
0
votes
0answers
29 views

How to covert image into string of binary?

How would you take an image file as an input and output it as a string of binary? Preferably in python.
1
vote
2answers
34 views

What is the equivalent of Python's encode() in Ruby

I am transferring a Python script to Ruby. The python method 'encode()' is used often. Examples: apikey.encode() encoded_payload = json.dumps(payload).encode() It looks like the Ruby equivalent has ...
0
votes
1answer
39 views

Python transform ascii hex to actual hex

How to transform this unicode hex string ? u'\x95\x93\xdfn\xe3D\x18\xc5q\xebv\xb3\xb4\xbb\x80\xb4H+\x84P\x05W,$\xfe......' To real this hex '\x95\x93\xdf\x6e\xe3\x44\x18\xc5\x71\xeb...'
0
votes
0answers
27 views

How to convert image from stdin to video using gstreamer

I am trying to convert images from stdin in real time to videos using gstreamer For example, I have some jpeg images in image folder named as img.%04d.jpeg. I want to stream the image as stdin to the ...
0
votes
0answers
29 views

Japanese Decode in Python - UTF-8 Problem

I have a python code that takes notes saved in Gmail and convert them from bytes to UTF-8. But It doesn't work well with Japanese. This is the code for the decoding. voice_command = email....
0
votes
0answers
37 views

How to Encode UI Objects in Xcode (Swift)?

My program crashes whenever I try to encode a tuple containing UI objects. I get an (lldb) crash on the AppDelegate (Thread 1: signal SIGABRT) I've attempted commenting out the tuple and it works ...
0
votes
0answers
16 views

Huffman tree encoding function not traversing the tree correctly

I am trying to write a Huffman tree encode function using a recursive helper, but the helper isn't traversing the tree other than the first char in the inputText. public String encode(String ...
0
votes
0answers
13 views

How can i config dynamic secret in CAS custome password Encoder

I have DB which have encoded password base on Spring Security 5.*! For now, I'm using CAS to make SSO app for my company. And I want to connect CAS with my DB and use PBKDF2 to encode the password. ...
0
votes
1answer
42 views

JSON encode non primitive types in Swift

Helo I would like to encode non standard types such as sims_float3x3 and [vector_float3]. What is the recommended way to this? I tried to use Struct like so, struct Example: Codable { var ...
0
votes
0answers
36 views

zlib will inflate a stream but text encoded in <> will stay in hex form

I am using embarcadero 10.3.1 c++, using zlib inflate. this code works, however, text in hex form is encoded. after the code below you will find the problem pdf ver. 1.7 size_t ...
0
votes
2answers
32 views

PHP create value variable for json_encode function

I'm using a JSON API; I want to create a variable with values and then convert it to a JSON string via json_encode. The (working) JSON string is this: $data =' { "function":"setArticleImages", "...
1
vote
1answer
43 views

Why linkedin widget on .net site renders junk characters?

We have a linkedin follow button widget on site.It works as expected in English language but when we choose location of machine (from control panel) to Sweden and set default primary language of ...
0
votes
1answer
16 views

How to encode latitude and longitude in one value in geodash2 (Python)?

I am trying to encode latitude and longitude like this: location_start = geohash2.encode(lat_start,lon_start, g) and get this error: ValueError: The truth value of a Series is ambiguous. Use a....
0
votes
0answers
29 views

Epplus when export list to excel some characters have rare values

I'm exporting a list to Excel with EPPlus in an asp.net app. As result, some string have strage characters (i.e Márgenes, it has to be Márgenes) How can I fix this? What I'm doing wrong? My ...
2
votes
1answer
52 views

How does “aaencode” convert javascript to emoticons?

In http://utf-8.jp/public/aaencode.html, any JavaScript can be Encoded to Japanese style emoticons, how does it work? For example, you can run the code below ゚ω゚ノ= /`m´)ノ ~┻━┻ //*´∇`*/ ['_']; o=(...
0
votes
2answers
17 views

Getting Invalid data on decode using appache common-codec library

I have scenario where I am getting my pkcs12 cert content as encoded string(appache common-codec library). Now I have to decode that string and have to store it file. But while decoding it as a string ...
0
votes
1answer
50 views

FFMPEG gets in never ending condition while live streaming on YouTube

I have been working in AS3 to stream 1080P video on YouTube and video gets start uploading and almost 4-5 minutes of the video has been uploaded successfully and afterwards YouTube shows that stream ...
2
votes
1answer
36 views

how to make encodeURI/decodeURI using java spring?

I have a simple api made with java spring, which receives texts and saves it in the database. And an application in javascript that formats the texts and sends them to api. I have texts in several ...
0
votes
1answer
40 views

Encode and Decode long string to short readable code

Suppose we have an object like: public class Record { public string ServerID {get;set;} public string UID {get;set;} } ServerID and UID are long string keys, I am trying to make that two ...
0
votes
0answers
26 views

How to make heavy json light?

i want responsd a json file to web client from server. it is very heavy. and, user can post a json file. it is heavy too. (about, 50~150mb) so, i have to find the way it make light. then, i think ...
1
vote
2answers
42 views

Iterate over two dataframes' columns and str.encode in utf8

I'm currently running on Python 2.7 and have two dataframes x and y. I would like to use some sort of list comprehension to iterate over both columns and use str.encode('UTF8) on each column to get ...
0
votes
1answer
29 views

How to correctly save html content in MYSQL table using PHP

How to correctly save HTML content in the MYSQL table using PHP. I used the following functions of PHP but no luck. $encodedHTML = htmlspecialchars($cs_htmlEditor); $encodedHTML = urlencode($...
0
votes
1answer
45 views

Sign the token payload using RSA algorithm

NOTE: Self signed certificate is installed on my machine. I have a JWT token, which I am trying to sign using RSA algorithm, I found a library "JOSE" for achieving the same with the below method. ...
-2
votes
1answer
49 views

special Chinese characters comparison [closed]

. There are something misunderstanding when comparing two characters "李","李". >>> "李" =="李" False >>> id("李") # fisrt one 140041303457584 >>> id("李") # second one ...
0
votes
2answers
116 views

Downloading and converting image to base64 results in corrupted data

I try to download an image using got and convert it to a base64-encoded string using a Buffer interface as responsetype. My current snippet converts the image and logs the encoded string to the ...
1
vote
0answers
20 views

Python Emailing with encoded deisgned ( html ) text

I have a working send email script which takes txt file and send it encoded. i want to be able to design (html) this encoded txt in the email body. i know how generally design a text in email body ...
0
votes
1answer
27 views

How do I read list of tuples as list type and tuples as tuple type in Python that are encoded in the form of string?

While reading list of tuples from file. The values are read as string, which was originally in list of tuple format. How do I get back the list from the string. I am posting a minimal version of my ...
0
votes
0answers
24 views

Python won't encode text file [duplicate]

I have a text file what is encoded in UTF-8. If I read the file and print it out I get an error: Traceback (most recent call last): File "D:/Projects/pyProjects/antiafk/log.py", line 27, in <...
0
votes
0answers
15 views

Problem when prints accents in Java with Input Stream and Argox

I trying to print some data in Argox OS-214 Plus (USB) with Java. It's printing the text properly, less the accented letters (including ç). I think it can be an encode problem when sending the data ...
0
votes
2answers
40 views

Base64 Encoding in Java vs HttpServerUtility.UrlTokenEncode in C#

I'm having a trouble while I tried to encode a String in Java. I have the follwing code in C#, and the string Bpz2Gjg01d7VfGfD8ZP1UA==, when I execute C# code I'm getting: ...
0
votes
1answer
297 views

Encode string for URL (angular)

I'm trying to encode a string that's pretty complex, so that I can include it in a mailto: Component: <a href="mailto:test@example.com?subject='Hello'&{{body}}"> TS: import { ...

http://mssss.yulina-kosm.ru