24,342 questions
1
vote
1
answer
54
views
Change micropython unicode notation from \xb0 to \u00b0 in string
I am using Micropython on the ESP32.
I have the following string, which includes the unicode character \xb0.
a = 'abc\xb0def'
First, I will need to change the notation to the \U00XX form, second I ...
Advice
0
votes
2
replies
104
views
Force all character columns in a list of data frames to UTF-8 before uploading to a UTF-8-only database
I have a list of two tables in R.
Each data frame contains several character and numeric columns. One of the columns is a company name column (for example, Company_Name).
The target database only ...
3
votes
2
answers
217
views
Is `use source::encoding "ascii";` implied by `use v5.42;`?
According to the new source::encoding pragma's documentation,
use source::encoding 'ascii' is automatically enabled within the lexical scope of a use v5.41.0 or higher.
To me, this means that
use v5....
0
votes
0
answers
44
views
Edit script file with salt-stack
There is a powershell script file on windows minions which has some parameters set the same on all minions and some parameters set individually per-minion. I want to create a state for modifying some ...
1
vote
1
answer
44
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(...
0
votes
0
answers
51
views
Redis data structure and storage optimzation
I have an application which keeps appending data for a wide range of sessionIDs and expiring them in a few hours, currently we use Redis List data structure and having the SessionID as the key.
For ...
0
votes
1
answer
87
views
Gmail API draft creation: Subject with UTF-8 accents (é, è, …) shows as mojibake (“é”)
I’m creating Gmail drafts via the Gmail API from N8N. The draft works and is correctly attached to the threadId, but accented characters in the subject (like adhésion) are displayed incorrectly (adhé...
0
votes
0
answers
47
views
How to show GBK encoded header in Mac version Unity editor properly?
I work on my project on both Mac and Windows. Some editor headers were written in Visual Studio on Windows in Chinese, and were encoded in GBK(default I guess). However they don't show properly on mac ...
-1
votes
1
answer
51
views
How to pass special chars to nodemailer?
I want to pass a string to nodemailer so that it results in
=C2=A0
i tried to pass in both 'Â ' (the literal chars), "\xC2\xA0", etc.
But they always result in =C3=A9
A longer example in ...
1
vote
2
answers
154
views
Given the string input, how can we traverse the binary tree recursively
Let's say our binary tree (bt) looks like this:
Node* root = new Node();
root->left = new Node("B");
root->right = new Node();
root->right->right = new Node("A");...
0
votes
0
answers
93
views
@ not recognized by cobol z open editor WHY?
I am writing a Cobol program in Visual Studio Code using the STRING and UNSTRING statements but for some reason when trying to use string functions on email addresses the Cobol program will not ...
-5
votes
1
answer
122
views
Swift: text/string vs. raw bytes? [closed]
I gave the following Swift-code to ChatGPT:
let data = text.data(using: .utf8)
It answered me:
"This line takes your string and turns it into raw bytes (data) that can be stored, sent over the ...
0
votes
0
answers
42
views
Email Encoding Issue [duplicate]
I send SMTP mail using PHP but there is an issue with the encoding.
$headers = "Content-type: text/html; charset=UTF-8\n";
Email message sent:
Where there's a dream
Email message received:
...
1
vote
1
answer
41
views
How is length of a string encoded when the bounds of the string are not defined in UPER encoding for the ASN when length exceeds 127
If I have the ASN.1 schema as shown below and I want to encode
message "...
0
votes
1
answer
228
views
PgLoader Migrate data from SQL Server to PostgreSQL server got error with character "ñ/í/..."
I'm using pgloader to migrate data from SQL Server to PostgreSQL server, the database is huge and I can't export to CSVv due to special characters. So I migrate db to db directly, almost done but it ...
1
vote
1
answer
119
views
C# ExcelDataReader reading foreign characters incorrectly from CSV
I created a console application in C#. The program refreshes host names in my database while reading data from an Excel sheet using ExcelDataReader.
The Excel file is saved in .CSV format. One of the ...
3
votes
1
answer
191
views
Delphi tstringlist encoding default
I have noticed recently (maybe a change in recent Delphi) that if I load an ASCII format txt file into a tstringlist, edit a line with file.lines[10]:='blah', and then save it again the file is now ...
0
votes
1
answer
87
views
How to correctly ABI-decode multicall results (ERC-20 decimals + symbol) in tests?
I’m trying to understand ABI decoding of multicall RPC calls so I can create stubbed tests using WireMock for my Rust EVM application.
The multicall function signature is:
function aggregate(Call[] ...
1
vote
3
answers
308
views
How can I reliably print a Unicode character to the terminal from C? [closed]
I'm maintaining a program (a compiler for an obscure language) that takes input in the form of text files. Existing code reads these files and converts their various encodings into a sequence of ...
1
vote
1
answer
83
views
Why doesn't file encoding setting in VS Code work?
I am using VS Code. I have a project where all the files are UTF-8. When I load the file in VS Code, it thinks it is ISO 8859-1 encoded. I can change the encoding using the option at the bottom to re-...
0
votes
0
answers
87
views
In Qt6, how do you set the encoding of a QTextStream to "EUC-JP"?
How do you set the encoding of a QTextStream to "EUC-JP" ?
The setEncoding function uses this enum:
class QStringConverter : public QStringConverterBase
{
public:
#endif // Qt 6 compat for ...
0
votes
1
answer
107
views
Incorrect text and emoji encoding when importing Meta (Instagram) chat JSON
I'm trying to learn how to use Power BI, and I thought it would be fun to test my skills by creating some statistics based on my chats with friends. For example, I want to identify the first message ...
1
vote
0
answers
105
views
No-breaking space not correctly encoded in oracle via JDBC
I've a legacy application which is loading csv files and load them to oracle DB. One line contains the non breaking character which is correctly read by the app (I can see the byte value -96 for the ...
2
votes
1
answer
154
views
Emojis won't show up properly in build logs for Maven Project name on Git Bash
I have a pom file whose name looks similar to this.
<name>Some Name 😊</name>
But when I performed the maven build, I got this instead.
Some Name 🙂
I set my project encoding to utf-8, ...
1
vote
0
answers
116
views
Pino Pretty not rendering accented characters correctly
I'm using pino with pino-pretty in a Node.js + TypeScript project, and I'm logging strings with accented characters (like ç, ã, é, etc.).
Example:
logger.info("Olá, Lucas! Teste de acentuação: ç, ...
1
vote
1
answer
164
views
Python 3.12 code in USS on z/OS Mainframe - Non-UTF-8 code on Line 1 issue
I'm new to using Python on z/OS; I am creating a program in a USS directory on our mainframe and using a Rocket Software 3270 emulator; I am trying to use square brackets in my code, but as soon as I ...
0
votes
0
answers
95
views
Error using python on z/OS - no encoding declared
I'm trying to write a python script under z/OS, using IBM Open Enterprise SDK for Python 3.13.
I wrote the code under TSO OMVS and I got the following error trying to execute the code:
SyntaxError: ...
0
votes
0
answers
42
views
RabbitMQ Configuration Entry Encode / Decode problem
I am working with RabbitMQ v3.12.0 which is running on Erlang v26.0.1. on a Windows 10 machine. The problem is that I am unable to successfully apply encrypted configuration entries. To simplify the ...
1
vote
1
answer
64
views
Encoding in R script
I am using the foreign package to read in 8 SPSS files. When they are read in some are re-encoded with UTF-8 and some with CP1252.
In my R script I want to compare an SPSS level with a piece of text. ...
0
votes
0
answers
85
views
Encoding tags In JSP
All 3 are working fine. I want to know which one is correct way ? what is the difference in below 3 different lines.
<%@ taglib uri="/WEB-INF/tlds/security/esapi.tld" prefix="en"...
2
votes
1
answer
154
views
How to fix broken German special characters when reading CSV file?
I am trying to load a German CSV file into R on Fedora Linux 42, but the region names containing special characters (like u-umlaut, o-umlaut, eszett) are not rendered correctly.
Here's a simplified ...
0
votes
2
answers
219
views
JAXB XJC encoding UTF-8 -> Unicode problem
I have a Java 17 application, on Windows OS, configured with Gradle, to unmarshall files into Java classes via .xsd scheme, which contains UTF-8 symbols, specifically, Russian symbols. It was unable ...
1
vote
1
answer
121
views
How to parse ASN.1 custom tags using Golang encoding/asn1?
I have a struct:
type V struct {
S int `asn1:"tag:1"`
}
Then I ASN.1 marshal this struct:
val := V{S: 12}
b, _ := asn1.Marshal(val)
Using dumpasn1 I got correct ASN.1:
0 3: ...
1
vote
0
answers
92
views
Inspect shows Charset Encoding of ISO even when i have mentioned UTF-8 in all files
When i open the menu of my web application, i use inspect > network tab and see that pdamnu.do file has charset encoding of ISO.
Now in my pdamnu.jsp i have mentioned the encoding of utf-8
<%@ ...
1
vote
1
answer
180
views
using std::filesystem with g++ 12.1.0 raises "Cannot convert character sequence: Invalid or incomplete multibyte or wide character"
I'm upgrading my compiler from g++ 8.2.0 to 12.1.0.
I have some legacy code using std::filesystem that starts failing with this upgrade.
I isolated the problem in a MCVE below. The code is supposed to ...
0
votes
0
answers
40
views
specify source code encoding for OUTPUT window in VS Code
In VS Code, my source code is in UTF-8 without BOM, when build the project, the OUTPUT window presents the comment with the code in mess.
How could I specify the encoding for the OUTPUT window?
I got ...
0
votes
1
answer
79
views
Is there a way to decode a specific string in Python? [closed]
I'm using Beautiful Soup to scrape Reddit. After scraping, I get some amount of encoding in the final text after finding the paragraph tag in the HTMl code and taking it's text.
# finds all paragraphs ...
0
votes
1
answer
96
views
"Unexpected EOF encountered in BCP data-file" when importing large CSV exported from SQLite
I'm facing a persistent issue when trying to import a .csv file into SQL Server using bcp. The operation always fails with the following error:
SQLState = S1000, NativeError = 0
Error = [Microsoft][...
0
votes
0
answers
45
views
Comparing strings received as bytes
I'm running a python script that receives data over a TCP connection. This connection can send multiple messages that consists of multiple variables which have multiple data types. When a string is ...
1
vote
0
answers
113
views
How to properly decode the payload of a pubsub message in pyspark / databricks?
I have a pull subscription to a pubsub topic.
example of message I'm sending:
{
"event_id": "200595",
"user_id": "15410",
"session_id": &...
0
votes
1
answer
114
views
Can't find proper encoding to open old ascii-encoded DBF files with Slovak, Czech, and German special characters
I'm working with a few old DBF files that contain special characters from the Slovak, Czech, and German alphabets (e.g., š, č, ř, ä, ö, ü). Both Python libraries dbfread and dbf indicate that the ...
0
votes
0
answers
36
views
Magstripe data decode
We are trying to decode some information on a gift card that is scanned via a mag stripe reader. When scanned the data on the mag stripe is
%B957197678665105^?;957197678665105=?
Printed on the card ...
0
votes
1
answer
81
views
Produce a slash in base64 string to test base64url encoding
I have a unit test for a Base64 URL safe function that I want to make sure that it is properly handling three things:
Replaces + with -
Replaces / with _
Trims = at end
I want my unit test to have a ...
0
votes
0
answers
131
views
How can I use a file .txt to store some passwords for many programs in python?
I have a file called password.txt and I want to store some passwords in it, I use it in a file of functions but I don't know how to make it usable for more than one file, every one having his specific ...
0
votes
1
answer
68
views
Cyrillic str encoded in Mysql inside PHP script [closed]
I have the string "тест123" in Cyrillic and am executing a MySQL query with it inside a PHP script.
However, the string in the query gets encoded and instead of "test123", it ...
0
votes
1
answer
101
views
Base 3 chunked encoder off by 1 bug
I'm trying to write an arbitrary base N chunked encoder. This is different than a mathematical encoder where the entire buffer is converted to an integer and then that integer is converted into a ...
0
votes
0
answers
37
views
Enforce UTF-8 in Build Result of Sublime Text
When I run a standalone Javascript using nodejs in the Sublime Text Editor:
console.log("Hellø World!");
The output is displayed in the Build Result pane:
Hellø World!
[Finished in 54ms]
...
0
votes
0
answers
95
views
Encoding problems with pytest
I have an error asserting equality between two string due to non-ASCII characters.
I am getting the table of contents (toc) of a PDF[1] with mymupdf.get_toc() function.
For the unit testing, I have ...
-1
votes
2
answers
102
views
Replacing literal '\uxxxx' in string with corresponding unicode character
I don't want to convert things like \n \r so I can't use unicode_escape directly.
But my code is very slow now, is there any better way?
def only_transform_backslash_u(content):
...
0
votes
0
answers
46
views
Pyasn1 enumerated type encodes as hex, how do I get decimal
I'm trying to code the following using pyasn1
From RFC7906
KeyPurpose ::= ENUMERATED {
n-a (0), -- Not Applicable
A (65), -- Operational
B (66), -- Compatible Multiple Key
...