Questions tagged [encode]

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

1
vote
1answer
66 views

Python - Confusion regarding how strings are stored and processed in Python

I am trying to read how strings work in Python and am having a tough time deciphering various functionalities. Here's what I understand. Hoping to get corrections and new perspectives as to how to ...
0
votes
0answers
31 views

What is encode type of this text “\u0110\u0103ng nh\u1eadp”?

This code was generated from Vietnamese by somebody. I need change this Vietnamese text for business. So what encode type of this text "u0110\u0103ng nh\u1eadp". More text: ## Page titles page.login....
-5
votes
0answers
44 views

password encoding algorithm used by PHP laravel

i should migration server. originally, i use node.js, but when user sign up, users'password was encrypted by laravel framework in php. so, i have to encrypt key in cookies, match to encoded value in ...
0
votes
1answer
61 views

c# converting string Encode Non Ascii Characters

I have this UI that needs unicode values to display superscript Characters. the data is coming inbound has html code.The only problem I can see is that it needs an extra backslash. I am passing a ...
0
votes
1answer
11 views

How to encode ObjectID in MongoDB or Strings

How to encode ObjectID in MongoDB or just strings in general. I want to encode this ObjectID that I have in MongoDB 5c8c8927c9c093b288acf44e so that later on I can decode it and get the same value.
-1
votes
4answers
35 views

PHP Function, Takes 2 Paramenters, JSON String and Date String and Returns JSON String

I am working over a PHP problem to Write a function that takes in two parameters: 1) a json string which contains articles 2) a string date in the format "2015-09-04" The function should return a json ...
1
vote
1answer
48 views

Is there a maximum base64 size for a encoded string?

I'm using Base64 for encode a very huge json string with thousands of data, after encoded i'm storing on disk. Later I'm retrieving again from disk and decoding it again into readable normal string ...
1
vote
2answers
47 views

encode and decode strange .shm file data to and from base64 c#

first a depressing fact: https://www.base64decode.org/ can do what i want to do. i´m trying to encode and decode (to and from base64) a model file (.shm) generated by the image processing tool MVTec ...
0
votes
0answers
37 views

encode json array in lua

I need to encode a json object with an array from a lua table. function encode_flow_record(type,a, b, c) local i = 1 while (parent~= nil) do local array[i] = {f1=a,f2=b,f3=c} ...
-1
votes
0answers
24 views

Save base64 string as png file

I am trying to save base64 string received from front end, as a file. Its a flask app. Following code saves image but its all grey. Flask Code: @app.route('/save-sign', methods=["POST", "GET"]) def ...
1
vote
0answers
37 views

UnicodeEncodeError: 'latin-1' codec can't encode character '\u201c' in position 2740: ordinal not in range(256)

I am receiving a UnicodeEncodeError: 'latin-1' codec can't encode character '\u201c' in position 2740: ordinal not in range(256) when trying to make a REST POST with the following code: import ...
0
votes
0answers
26 views

How to display picture file comment when comment is html code?

I'm displaying on my website comments that I put to comment section in picture properties. I'm using this function: <?php $exif = exif_read_data("samochody/$brand/${'Model_B'.$i}/$brand-${...
0
votes
0answers
17 views

.htaccess mask url with query encode

I am new one, I learn .htaccess. I want to customize my URL from link.php?id=http%3A%2F%2Fwww.web.com%2F to link/http%3A%2F%2Fwww.web.com%2F and redirect to http%3A%2F%2Fwww.web.com%2F properly I ...
0
votes
2answers
60 views

How to correctly encode and decode a string in Base64?

I want to encode a string in Base64 for later decoding it. I encode it doing this: public static String encryptString(String string) { byte[] bytesEncoded = Base64.getEncoder().encode(string....
0
votes
2answers
57 views

iterate over columns pandas to encode dtype object to categorical value

I have a dataset full of categorical values that are not encoded at the moment. For instance, I have a variable called condition which has these values: Very Excellent, Excellent, Very Good I want to ...
1
vote
1answer
55 views

How to make encode and decode functions as I want?

--encode function strToBytes(str) local bytes = { str:byte(1, -1) for i = 1, #bytes do bytes[i] = bytes[i] + 100 end return table.concat(bytes, ',') end --decode function bytesToStr(str) ...
0
votes
1answer
44 views

Need to generate runtime binary encoded file in golang

I am working on the project in which I need to generate a file as binary encoded(bytes). Thing is that, I don't want to store the file but just need the encoded data to verify with some test data. ...
0
votes
1answer
24 views

Decoding / Encoding Foreign Characters / UnicodeEncodeError: 'charmap' codec

I'm trying to export some tweets into json file but am getting errors. When I don't get errors it puts a 'b' character in my data and therefore messes up my json format. Here's my example and code: ...
1
vote
1answer
21 views

convert image to YUV format (different types: BT.601 or BT.709) and save it in the raw format

Is there a tool that can convert a given image (jpg) into YUV format and save it as a raw data ? I tried Python PIL, but failed to find how to do this. Thanks for any idea.
1
vote
0answers
35 views

Encode letter to number

I feel like I am failing everything this semester. but I was wondering if you all could help me with a JS project. We have been tasked with essentially converting numbers to letters and vica versa ...
0
votes
0answers
18 views

How can I get responseEncoding Windows-874 in Axios

I use Axios request for get XML axios.get('http://process3.gprocurement.go.th/EPROCRssFeedWeb/egpannouncerss.xml?deptId=0304', { responseEncoding: 'Windows-874', }) .then(function (...
-1
votes
2answers
43 views

Transfer Base64 from PHP to Javascript

First of all I'm new here and new in the programming business. :) So my problem: I have Base64 images witch are stored in a database. Now i am selecting the data with PHP but i need the Data in ...
0
votes
1answer
13 views

How to do URL encoder in Hyperledger composer

I need to do query inside logic.js with special character. I have already done the query logic. My problem occurs when I put special character as one of the parameter. When I put 'がが', it cannot ...
2
votes
2answers
80 views

How to get bytes of a String in Dart?

How can I read the bytes of a String in dart? in Java it is possible through the String method getBytes(). See example
0
votes
0answers
22 views

Check if URL as a string is already encoded in Java [duplicate]

In Java, how to check if URL as a string is already encoded before doing encoding to prevent double encoding? The URL string has a query parameter like '5FLu%2FRJ09FUaG' which is already encoded and ...
0
votes
1answer
49 views

Unreadable JSON answer in Swift

I'm using this code to send a post request to an api: @IBAction func loadServicesTestButton(_ sender: UIButton) { DispatchQueue.main.async { let headers = [ "...
0
votes
0answers
14 views

Special Characters + Cookies

I have a function in javascript that grabs my UTM_SOURCE Cookie for Salesforce with the name LSKey[c]utm_source. The problem is when I store the cookie, chrome inspect decodes the brackets [] ...
0
votes
0answers
46 views

Python: UnicodeEncodeError: 'ascii' codec can't encode characters

I am trying to write a dataframe to an oracle sql database. My input file is an xlsx file therefore i used the read_excel function to put it as an dataframe first: df = pd.read_excel('myfile.xlsx', ...
1
vote
1answer
60 views

Base64 does not encode the entire string

When I encode tex, for some reason it cuts off part of the string ... What could be the problem? DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss a", Locale....
2
votes
2answers
67 views

Json encode in the Wrong Format

I am trying to make some statistics over visits on my site. I know that I could use Google Analytics(wich I do), but i want to try to do something myself and it is a good way to learn it. Problem: I ...
1
vote
0answers
22 views

TypeError: can't concat bytes to str in Python 3.5.1

I'm getting an error even after setting base64 encoding: Traceback (most recent call last): File "api_tufin_5.py", line 41, in <module> main(sys.argv[1:]) File "api_tufin_5.py", line 28,...
0
votes
0answers
76 views

How to solve this cryptograph

I have a CTF challenge with my IT teacher. I need to decode the following: Challenge: =D2AttwAtDmAttmZtVmZtLJAtHwAttwAtDmAtLJAtHm AtNmZtxmAtLJAtZmZtZmZtZmAtLJAtZzAtZzAtxwAtpm ...
0
votes
1answer
39 views

Python; Encode to MD5 (hashlib) shows error: “NoneType”

I wrote a code that will generate random password for 5 times, and I would like to encode that passwords to MD5, but when I try to encode it, it will show an error that 'NoneType' object has no ...
0
votes
2answers
26 views

Groovy encodeBase64() returning unexpected result for PNG image file

I am trying to convert a PNG image file to Base64 encoding in Groovy. Here is my code: ImageFile = new File("D:/DATA/CustomScript/Logo.png").text; String encoded = ImageFile.getBytes()....
0
votes
2answers
44 views

What is the right way to encode a string with backslashes? [duplicate]

In the given example: "\info\more info\nName" how would I turn this into bytes I tried using unicode-escape but that didn't seem to work :( data ="\info\more info\nName" dataV2 = str.encode(data) ...
0
votes
0answers
45 views

WebTestClient The request was rejected because the URL contained a potentially malicious String

I am using WebTestClient to test rest api. I getting an exception org.springframework.security.web.firewall.RequestRejectedException The request was rejected because the URL contained a potentially ...
0
votes
1answer
21 views

Label Encoding n-dimensional categorical values

I came across this article Label encoding across multiple columns in scikit-learn and one of the comments http://resolved-error.com/a/30267328/10058906 explained how each value for a given column is ...
0
votes
1answer
39 views

Get and decode a response from RestTemplate spring boot

I am encoding a URL and when I get the response back it is encoded as well. What I am having a issue with is decoding it. String encoded = URLEncoder.encode(text,"UTF-8"); ...
1
vote
0answers
49 views

loading .mat file into python causing 'buffer is too small for requested array' error

I have the following python code (its dummy data) import scipy.io as si data = [0 ,1] metadata = {'Location_City': {'loíza': '0'}} metadata_b = bytes(str(metadata), 'utf-8') result_dict = {'d':data, ...
0
votes
1answer
38 views

base64 encoding not taking mime message

I am trying to send an oauth gmail using python and am not able to create MimeMessages that agree with Google's API. After creating a sample message, I use base64 to encode it as a string. However, I ...
0
votes
0answers
18 views

How to escape or pass / in Http Task URL in flowable modeler?

I have to call a RabbitMQ API to publish some message to a queue in default Virtual Host namely "/" which can be encoded as %2F but the same is not working in flowable-modeler and giving 405 Method ...
1
vote
2answers
42 views

UnicodeEncodeError in BeautifulSoup webscraper

I'm having a unicode encode error with the following code for a simple web scraper. print 'JSON scraper initializing' from bs4 import BeautifulSoup import json import requests import geocoder # Set ...
2
votes
2answers
60 views

Get only ASCII values from byte-encoded python string with hex characters

When I am trying to get data from a table in redshift and create a CSV file from it but while doing it I am facing a problem with bytes. b'INTERLEAVED\xff\x01\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\...
-1
votes
2answers
41 views

URL being re-encoded?

I have a few links that look like this: https://www.example.com/find?category=food%20%26%20drink Clicking on the link should take me to a page where I can GET the variable, and it SHOULD read "food &...
0
votes
0answers
25 views

Request.Form getting decoded in Controller .Net core 2.1

User entered a special char (ä) and also % symbol in address field of a form. Post call happens on saving form and here is how the form data on browser looks like - ä encoded as %E4 and % symbol ...
1
vote
0answers
48 views

Encode string as file path fragment in PHP

In PHP, the function urlencode() allows to encode a string as a url fragment, encoding all characters that might have a special meaning in a url. The encoding is reversible with urldecode(). I am ...
0
votes
1answer
26 views

Am I using encode correctly/incorrectly in Python 3 to convert a string into bytes?

I'm a little confused about the encode and bytes functions, when I do a conversion from string to bytes, I'm getting additional bytes. Where are the additional bytes coming from (in the conversion)? ...
0
votes
0answers
34 views

I cant install a virtual environment

I'm using git-bash on windows and i'm trying to install a virtual environment,I installed virtualenv but when i type virtualenv −−system−site−packages .venvs/lpthw (i made a .venvs directory by typing ...
0
votes
1answer
50 views

encodeURIComponent on dynamic request url, node.js

I am requesting an index.djvu that fires requests for documents by id. The requests id that the index.djvu fires is Base64 encoded e.g document/page_1_1_1_k21g_MjE4MGstMTAvMTE=.djvu where the id is ...
0
votes
1answer
29 views

base64 encoder returns undefined in react

I'm trying to make an api request, to my server where i have some files, that I'm sending along. I have made an array of custom objects, where i have two parameters, the file extension and the raw ...

http://mssss.yulina-kosm.ru