3,168 questions
1
vote
1
answer
47
views
pandas.read_csv uses only utf-8 encoding for django file upload
I'm testing django using file uploads. Was facing a strange issue, when despide which encoding I choose, I'm always getting same error message that pandas is trying to decode with UTF-8
pd.read_csv(...
1
vote
1
answer
111
views
Encode.pm UTF-8 vs utf-8 vs UTF8 code example does not work as I expected
I'm trying to understand the difference between UTF-8, utf-8, and UTF8 as described at the very bottom of Encode.pm.
#!/usr/bin/perl
use strict;
use warnings;
use Encode;
printf "Perl: %s, ...
0
votes
0
answers
153
views
LI-FI based image transmission using ESP32
Dears, i'm working on a LiFi image transmission project using ESP32 microcontrollers.
I then use 2 microcontrollers, one as transmitter through laser and another as receiver through an LDR. So far, ...
2
votes
1
answer
142
views
How to convert a string variable into a numeric variable?
I have data from a survey with variables containing strings that I would like to convert to a numeric value for analysis. They also contain some blanks. I use Stata 15.1 to perform the analysis. Here ...
-2
votes
2
answers
133
views
How can I extract data from this encoded string? [closed]
I received this string as a response from a private API of a sports betting site: https://sport.synottip.cz:
...
0
votes
0
answers
95
views
Why Java Encoder and Decoder Not Working Correctly
How to properly encode strings in java? I'm trying to encode the letter Ü in utf-8 and I'm getting garbage results - d093d19a instead of C39C. What could be the problem?
package org.example;
import ...
2
votes
2
answers
367
views
Encode Struct to map[string]any with mapstructure.DecodeHookFunc
How can I encode struct with github.com/mitchellh/mapstructure, like:
type Struct struct {
CreateDate *timestamppb.Timestamp `mapstructure:"create_date"`
}
to:
map[string]any{
"...
0
votes
1
answer
101
views
Encode is giving error as "The data couldn't be written because it isn't in the correct format"
I have one API where based on parameters data is changing.
Response 1
{
"success": true,
"statusCode": 200,
"errorLst": [],
"succcessMessage": null,
&...
-1
votes
1
answer
90
views
PHP JWT not verified other than PHP [closed]
I am using PHP firebase JWT for implementation of JWT in my PHP app. Here is my code
$payload = [
'iss' => 'http://test.com',
'aud' => 'http://test.com',
'iat' =&...
0
votes
2
answers
482
views
How to create kubernetes generic secret without base64 encoding?
for example I'm creating a kubernetes generic secret using following:
kubectl create secret generic passwords \
--from-literal=TestUser='mypass' -n mynamespace
And I will get the following secret:
# ...
2
votes
2
answers
130
views
How to correctly encode special characters in URL parameters with `requests.get()` in Python?
I want to grab some content from a website using requests.get() on jupyter notebook, with a Python version of 3.10.
The website is a simple search engine with a search bar and some buttons.
When I ...
0
votes
1
answer
107
views
Raw gzip data contains non-ASCII characters
I am working with gzip raw data that contains non-ASCII characters that I am unable to decompress and decode.
I am getting the data from Firestore through the python client and the payload looks like:
...
0
votes
0
answers
53
views
How to remove encoded characters in a column? [duplicate]
I'm cleaning a dataset and there's a column named 'city' which the city name has encoded characters.
My first try was to use the method decoded, but then I noticed the city names were in string format:...
1
vote
4
answers
165
views
Create regex-like (run length encoding) of string s for blocks of a given length k
I am looking for python code to perform a run length encoding to obtain a regex-like summary of a string s, for a known length k for the blocks. How should I tackle this?
e.g.
s=...
1
vote
1
answer
129
views
like / ilike with encode(bytea) not work with unicode
I have a system where I need to compare bytea values (case insensitive in this case). For this purpose, I use encode to convert the bytea values into strings which I then compare. This works as ...
1
vote
1
answer
150
views
Convert packet bytes in powershell
I'm using tshark to get packet data from pcap. I want to know the website url that the tcp.stream is connected to. The only place I can see that will have that is the certificate. If there's another ...
1
vote
1
answer
27
views
Differentiate two Cyrillic strings
When I run a query for this string in SQLite with these entries in Cyrillic in a text field, I only find one.
When I put the two strings in two different cells in Excel and search, it only finds the ...
1
vote
0
answers
48
views
Go/Xml Namespaces
I'm defining an XML structure in Go using the encoding/xml package where the XML name contains the URL of the xsi and xsd namespaces.
Here's my struct:
struct:
type MensagemEnvioANS struct {
...
1
vote
1
answer
37
views
Label encoder the target in Pipeline
I want to create a pipeline to do preprocessing in both training features and target, then train the model. Dataset would be something like:
v1 v2 target
0 1 a yes
1 5 c no
2 3 f ...
1
vote
1
answer
891
views
Encode a list of sentences into embeddings using a HuggingFace model not in its hub
I am trying to encode a list of sentences into a list of embeddings. When I use a model that is in the HuggingFace hub, it works as expected. But when I use a model not in the hub, in this case ...
0
votes
0
answers
45
views
why the output is Incomprehensible
I am a web developer and I don't know anything about AI, but one of my frinds send me some python code and asked why it's not working
from transformers import GPT2LMHeadModel, GPT2Tokenizer
tokenizer ...
0
votes
3
answers
110
views
How can I compress text in Python to only use certain characters?
How can I compress text in Python but the output string only contains upper and lowercase letters, numbers, "." (dot), and "_" (underscore).
Here is an example of something that ...
-1
votes
1
answer
76
views
can i decode websocket message in developer tools console?
can i decode websocket message in developer tools with vanilla js??
this is the code for example :
(function(send) {
WebSocket.prototype.send = function(data) {
if (data instanceof ...
0
votes
1
answer
819
views
IntelliJ IDEA 2024.1 - Change the encoding used to view a file
I want to Change the encoding used to view a file, but the encoding option is disabled
the bottom right of the IJ window is read-only:
0
votes
0
answers
124
views
Is merge in Byte Pair encoding (BPE) optimal?
Let a string be s = "aeeefeekeelaeoae",
Vocab: {a, e, f, k, l, o} (set of characters in s)
Lets say I performed Byte Pair Encoding (BPE) on s and I want number of merges to be 2 such that my ...
0
votes
0
answers
70
views
firebird extraction 'utf-8' codec can't decode byte 0xe3 in position
I'm trying to extract data from a Firebird database using Python, but I keep encountering the same error no matter what encoding I try.
'utf-8' codec can't decode byte 0xe3 in position
def get_conn(...
0
votes
1
answer
99
views
How can I use lua language json.encode without breaking the order of the list?
I have a list like below in Lua, I send this list to the js side in json format using json.encode() code. But the problem is that the order of this list is changed by json.encode every time. So my ...
1
vote
0
answers
152
views
How to resolve path with emoji in src? Next.js
I didn't expect it to be a problem to get an images with emojies in their paths:
/img/shops/main/text🍪.webp
/img/shops/main/text💎💎💎.jpg
/img/shops/main/text💸💸.jpg
/img/shops/main/🙂text🙂.webp
/...
0
votes
1
answer
104
views
How to sanitise request body in spring boot if some attributes contain these values
Is there any library available to encode these if present as values eg. can be html attributes, js events, scripts, expressions evaluating to true? Though it should escape values like ">50000&...
0
votes
0
answers
31
views
abinitio cant decode encoded sha256 value [duplicate]
I can encode a decimal value in abinitio but I can not decode the hashed value. I have some files that keep only hashed values, I want to decode them and later on join them based on decoded values.
...
1
vote
1
answer
73
views
How to encode ConvertAPI secret while converting
I am using convertAPI in angular as javascript
let convertApi = ConvertApi.auth({ secret: 'xxxxxxxxxxxxx' });
The secret is visible in the network tab but I want to make it secure.
So, I just want to ...
0
votes
1
answer
94
views
Using encode command to convert string variable to numeric
I have a variable named education, with 0 = primary 1 = secondary 2 = tertiary.
I used encode command to change it from string to numeric, whilst maintaining the labels by:
label define edulabel 0 &...
1
vote
1
answer
44
views
Python, url changes while executed in requests.get() and results in the famous UnicodeDecodeError
I use Visual Studio Code. Python version 3.12.2. Beautifulsoup version 4.12.3. I'm on Windows 11. Files encoding is set to: utf-8.
This is my code sample in VS code:
import requests
import urllib....
0
votes
0
answers
66
views
Disable Encoding Process on RestTemplate Springboot XML Request
Is it possible to disable encoding process when request XML with RestTemplate?
I need to send my value like this
ud=HELLOOOO YEYEYE🥺🥺©À¥¥didi🥺wawa©yayuÀ
ud=HELLOOOO YEYEYE🥺🥺&...
0
votes
0
answers
54
views
Python - Unicode & Character Encodings in Python
I encounter a lot of encoding and decoding problems so I read a lot about it but I just can't get a grip on it. The logic just confuses me and escapes me so I'm kind of lost.
To extend my knowledge ...
0
votes
1
answer
97
views
problem in pass php array to js function contain space in array items
i pass a php array to js function. but array items contain space. for example for name="Ali alavi".
when i use encode_json($value) to pass js function , i got error: (if my items contain ...
0
votes
0
answers
81
views
SQL Server Special Characters Sort By
I want to sort using SQL_Romanian_CP1250_CS_AS and as a result I get:
Du
Șe
Ge
Which should be
Du
Ge
Șe
I think that it ignores the special character and I don't know why.
I try different Fonts, ...
-1
votes
1
answer
227
views
UnicodeEncodeError: 'ascii' codec can't encode character '\xed' in position 16: ordinal not in range(128)
I'm learning pandas and trying to get the table of a wikipedia page in Jupyter and I got this error:
UnicodeEncodeError: 'ascii' codec can't encode character '\xed' in position 16: ordinal not in ...
0
votes
0
answers
77
views
_io.StringIO object has no attribute 'encode'
im trying to convert pdf file to rtf format and i got this error _io.StringIO object has no attribute 'encode' so if any one with an idea how to fix it please share it with me.
i don't know from where ...
0
votes
1
answer
1k
views
Saving a pandas dataframe in excel with utf-8 encoding
Simply want to set the encoding of an excel workbook for saving data. All data is stored in a pandas dataframe.
Code below:
file_name = "bobs_burgers"
with pd.ExcelWriter(r".\...
0
votes
1
answer
128
views
Fetch and display image in React JS
I have a code block like this. I am getting data with this Function.
cloudApi.jsx file:
export const fileApi = axios.create({
baseURL: cloud_url,
headers: {
"Content-Type": "...
0
votes
2
answers
50
views
Still getting an error after using encode() when trying to write into a csv file
Here's an example of the code:
import csv
file = open("countries_information.csv", 'wb')
writer = csv.writer(file)
writer.writerow(['Country Name'.encode("utf-8)])
I get the error
&...
3
votes
1
answer
2k
views
convert base64 to json in javaScript
For example, I have a base64 code like this
const base64 = "H4sIAAAAAAAEAO2b0W6CMBSGz6MsXm+JUKi6N9gzLLsw4jYTo0bJbpa9+44Ig0J7kBW0PSENNG2B9vtjw09PfYVvmMAGEjw/...
0
votes
1
answer
308
views
React Native Fetch API In IOS Only Semicolon In Url Not Encoded
So I'm using React Native for an IOS App, and using Fetch API for networking. My URL is like this:
https://example.testing.com/filterString=product.code><CODE01;CODE02
and it's usually ...
0
votes
0
answers
98
views
Using RNCryptor to decrypt data throws "Decryption error: unknownHeader"
I have used RNCryptor in my objective-c project to encrypt and decrypt a plist data file. Now I am recreating the project in Swift. When I try to decrypt the plist data in swift project which was ...
0
votes
1
answer
168
views
retrieving data from a server and processing calculations
My code is supposed to connect to the 37.59.31.202 server on port 2000 using the socket module. I then need to send the results of the 100 calculations sent by the server over the connection. My ...
3
votes
1
answer
259
views
How to create a sorted key-value map that can be serialized by Gin to json?
I'm using Gin to create a REST API. The response I'm trying to create is a key-value json map such as:
"content": {
"1.4.5.": {
"id": "1.4.5.&...
-2
votes
1
answer
73
views
I want to replace backlashes in python, replacing \\ by \ in a byte sequence [duplicate]
So I have a byte sequence that looks like this:
key = b"b')F\\x87\\x86\\xfc~Z\\xaa\\x15pf}\\xe6\\x9f\\xf5\\xd0' "
and I want it to look like this: b')F\x87\x86\xfc~Z\xaa\x15pf}\xe6\x9f\xf5\...
0
votes
0
answers
188
views
Memory Alloc Space / Leak Problem in Golang
We are facing a memory leak in golang rest api + ecs which can be fixed only after restart.
Problem :
memory does not go above 0.7. At 0.7 memory Go App stops responding and we have to restart it.
**...
1
vote
1
answer
169
views
Error when using #include "Poco/Base64Encoder.h" in C++
I want to use base64 in the poco library to encode content in the file. The error I have encountering, LNK2019, indicates that the linker is unable to find the implementation of the Poco::...