1,066 questions
1
vote
0
answers
48
views
Renaming files within 7z archive not working via Python script but does work via Bash
I have a fairly specific issue that I have been trying to solve for days to no avail. I have a Python script that opens archive files, decompresses them, and re-compresses them as zip files for ...
0
votes
1
answer
66
views
Unexpected behaviour of tkinter combobox with high-numbered Unicode
I am trying to display unicode characters in a Combobox using Tkinter.
For this example, I don't fill a drop-down list, I only use the entry field.
I already watched stack overflow topics:
how to use ...
1
vote
2
answers
176
views
Python : Unicode 16.0 and Unicode 15.1 characters
I'm trying to generate all unicode 16.0 characters on a file and all unicode 15.1 characters on a other file and display on a new file the added characters on unicode 16.0.
I tried this code, but this ...
0
votes
1
answer
115
views
Python3 UnicodeDecodeError on utf8
No matter what I do I couldn't fix it.
The script I need to fix is this;
# Read the original file and write to a new file
input_file = 'input.txt'
output_file = 'output.txt'
with open(input_file, 'rb'...
2
votes
1
answer
212
views
How to convert unicode black pawn emoji to black pawn text character?
I'm making chess in Python 3.12 using purely text for a challenge. The IDE I'm using is Visual Studio 2022. All the other unicode characters, including the white pawn, render as their text character ...
1
vote
1
answer
130
views
Why does emoji U+1F60A contain a new line character in UTF-16 when reading it?
We have a file that, when opened with normal file readers, such as Notepad++, the emoji is rendered successfully and no extra new lines are added.
The problem we are facing is that, when opening the ...
0
votes
0
answers
144
views
Turkish İ lowercasing as two characters: is this a bug in Python? [duplicate]
I found out that the Turkish/Azeri LATIN CAPITAL LETTER I WITH DOT ABOVE (U+0130, İ) is the only character that gets converted into two when I use the .lower() method in Python.
my_str = "İZMİR ...
0
votes
0
answers
79
views
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 31: invalid start byte
I'm encountering this error only on file in a list of seemingly identical files. My code is as follows:
data_dir = 'C:/Users\ebook\Downloads\Batch One Set\Sample Output'
for filepath in (os.listdir(...
0
votes
1
answer
84
views
How to ignore space in Sound Mark during Unicode Composition/Decomposition in Japanese text?
I have two different tables with data, in one of them Katakana-Hiragana Sound Mark is part of the previous character, in another it's a separate symbol. I need to match values between the two tables. ...
0
votes
0
answers
108
views
UnicodeDecodeError when opening a .sql file using pandas read_sql_query
I need to analyze data from sql server. The process is memory heavy which requires me to use my university's computing resources as opposed my personal computer. Due to university policy, I cannot ...
0
votes
1
answer
120
views
Python json.load Decode Error Expecting ':' delimiter [closed]
So I have a massive .json file containing a dictionary. It looks basically like this:
{"[deleted]": {"8gwmc": 1241136488, "8gtzp": 1241116576, "8gogw": ...
1
vote
1
answer
42
views
Unable to write data in file
I have data stored in one file - delimiter tab
{'id': '123', 'name': 'pečnostní informační služba'}
When I am trying to read the data and write data in 2nd file using python code but getting error
...
0
votes
0
answers
100
views
I used this code to send mails until error "UnicodeEncodeError: 'ascii' codec can't encode characters in position 36-37: ordinal not in range(128)"
Using the following code I could send mails automatically until i receive the error UnicodeEncodeError: 'ascii' codec can't encode characters in position 36-37: ordinal not in range(128)". From ...
0
votes
1
answer
117
views
Pycharm Unicode Produces Box with Question Mark
I'm running Pycharm on a Mac Mini and another instance of Pycharm on a MacBook Air. Unicode for superscript 2 (\u2072) works on Pycharm on the Mini but not on Pycharm on the MacBook Air. On the MBA ...
0
votes
1
answer
86
views
How to check a character is belong or not belong to specific code page?
I want to print the character only if it is not belong to specific code page.
What function I can use for this purpose?
with open('in.txt', 'r', encoding="utf-16-le") as f:
while True:
...
0
votes
1
answer
89
views
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 2: invalid start byte | Decoding File Size | Python
I tried file encryption method using Crypto Library. But have a problem with receiving side try to decode file size. This is my code
Sender Code
client.send('file.txt'.encode())
client.send(str(...
0
votes
0
answers
96
views
Python UnicodeDecodeError on third-party python files after Linux system update
I started running into an issue after a recent system update on my Ubuntu machine. A lot of third-party python files suddenly are throwing UnicodeDecodeErrors like this:
ERROR : startup/gui/menus.py : ...
0
votes
1
answer
350
views
Azure Text To Speech (TTS) fails with HTTP 400 Error on Japanese Characters
I’m a student using Python to access the REST API for the TTS Azure Cognitive Service. I’m testing a file created with Azure’s online Audio Content Creation Tool with the following (a Japanese ...
0
votes
0
answers
146
views
Python Unicode Normalization Can Not Normalize '\u0069\u0307' (i̇)
I'm working with Python's unicodedata module to normalize strings, but I'm encountering an unexpected behavior with a particular character. My goal is to normalize a string containing the character &...
-1
votes
3
answers
279
views
Unable to remove unicode in specific scenario and am completely lost on why this is happening
I was running into an issue where given a string, I want to use unicodedata.normalize("NFKD",raw_data) in order to remove a particular problem point for my data cleanser. However I have ran ...
0
votes
0
answers
212
views
Python importlib.resources.files() throws UnicodeDecodeError: invalid continuation byte
I am creating a Python package that needs certain data files in order to work. I've been looking for a way to include these data files with the package installation. I found a way using importlib....
2
votes
1
answer
104
views
Could not convert string to float: Python code for a pH meter
I'm new to coding and am attempting to build a pH meter with pre-written code for the GUI. I've double checked all connections in my instrument, but the python code is the last thing crashing. When I ...
0
votes
1
answer
261
views
Correctly embedding and extracting Unicode data from an image
I recently asked a question about embedding data into an image. I promptly solved that issue with help from other forums. I have run into a new problem: my program works fine for all Latin characters ...
1
vote
0
answers
101
views
os.open with non-utf8 characters in file name
I am trying to copy a file from a source NFS volume to destination NFS volume.
The file name has non-utf8 character and I am using bytes to open/read/write.
Using os.open, the path opens fine on the ...
1
vote
0
answers
690
views
How to handle ligature issue while using pdf text
I need to capture some text from some PDFs. I use PymuPDF to do this. But facing ligature issue while writing those selected text inside a text file.
I use the following code snippet to read the PDF
...
2
votes
1
answer
589
views
UnicodeDecodeError: 'utf-8'/'ascii' codec can't decode byte 0xe2 in position 31
I have an input csv file and when I try to do some operations on it and make an output file, I am getting this error.
At first I got the 'utf-8' Error so I searched and checked the encoding of my file ...
0
votes
1
answer
80
views
How to use UTF-8 encoding for unicode objects in python correctly
In one of the python module, there is this name string that contains non-ascii characters. While logging this object, python gives UnicodeDecodeError. For example:
# coding: UTF-8
import logging
...
1
vote
0
answers
227
views
Reportlab is not properly rendering Indian text malayalam
I am trying to generate pdf using reportlab, with malayalam text(an Indian language).
My code:
# -*- coding: utf-8 -*-
from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfmetrics
from ...
0
votes
1
answer
156
views
Using UTF-8 in Python 3 string literals
I have a script I'm writing where I need to print the character sequence "Qä" to the terminal. My terminal is using UTF-8 encoding. My file has # -*- coding: utf-8 -*- at the top of it, ...
0
votes
1
answer
71
views
pandas' dataframes merge challenge with identical strings but different unicodes
I have a problem using pd.merge when some of the rows in the two columns in the two datasets I use to merge the two datasets have different unicodes even though the strings are identical. Here is one ...
0
votes
0
answers
92
views
Why are custom unicode characters sometimes not printing to the terminal in python?
I have created a custom font and mapped a few new characters to unmapped unicode codepoints. This works fairly well, but these characters are seemingly randomly getting converted into their codepoint ...
0
votes
1
answer
35
views
Python - wierd UnicodeEncodeError
I am using Python 3.6 in centos server, and I am trying to write a script outside the scope of django (though it is installed).
All the script need to do is some kind of logging, but it may have ...
0
votes
2
answers
374
views
How to output multibyte unicode character?
What I want to do
I want to output superscript character in making a scientific report. It is like 'A/cm2'('2' in this case). I managed to find a character map in unicode shown below. As for this case ...
0
votes
0
answers
435
views
UnicodeDecodeError Persisting with JSON File
While loading a JSON file, a "UnicodeDecodeError" with the message "'utf-8' codec can't decode byte" repeatedly came up. After doing some digging, it's my understanding that the ...
2
votes
0
answers
296
views
How to get Python Notebook (Jupyter/Colab) to reliably display emoji-variants of unicode characters?
The Unicode U+FE0F invisible variation-selector character will often – & dare I say is supposed-to – cause many specific preceding characters to adopt an 'emoji' presentation, with standard emoji-...
0
votes
1
answer
549
views
Encoding Unicoded emoji from CSV file with text strings together
I have an issue with encoding of unicodes from CSV file. I have looked at SO , but does not give a proper solution.
My CSV file is so,
Subject1,u"\U0001f3c6 Campaign for you"
Subject2,\...
0
votes
2
answers
83
views
How to install classeval in python? UnicodeDecode Error in classeval installation
I receive an UnicodeDecode error when I try to install classeval (idk if important, but actually i received this error while trying to install hgboost).
Here it is:
pip install classeval
output:
...
1
vote
0
answers
40
views
I ran a command that was supposed to show me the data about my object detection ai but i get an error that i can't solve
basically i have this command:
python Tensorflow\models\research\object_detection\model_main_tf2.py --model_dir=Tensorflow\workspace\models\my_ssd_mobnet --pipeline_config_path=Tensorflow\workspace\...
1
vote
1
answer
206
views
Draw tickmark or checkmark with PIL
I tried Arial, Wingdings and other fonts... but can't get the tickmark printed on my image.
Please let me know what am I doing wrong?
Code:
from PIL import Image, ImageDraw, ImageFont, ImageFilter
...
3
votes
3
answers
4k
views
"index = VectorstoreIndexCreator().from_loaders(loaders) index". PDF fileendings
I am successfully answering questions from multiple PDFs on my M1 mac. But having some issues with certain pdfs.
I am running anaconda with Langchain. The PDFs are variable sizes from 100K to 3meg. ...
0
votes
0
answers
393
views
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 562: ordinal not in range(128)
i'm having problems working in a python version 2.6.6. I explain why I use this version: I'm working with a program created several years ago (find the project here https://github.com/danthedeckie/...
0
votes
1
answer
536
views
Invalid continuation byte while reading .txt file
I'm getting this error in my python code:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 5884: invalid continuation byte
The script is for a dictionary attack using the ...
0
votes
0
answers
435
views
How to fix error UnicodeDecodeError: utf-8 codec can't decode byte in position 0: invalid start byte
I am not a programmer and I am trying to use a serial GPS module with RPi 4B.
When I run the Python code, most of the time I get the error message, probably because when the serial is opened my GPS ...
-1
votes
1
answer
99
views
Unicode subscript r inconsistent
I want to use the following unicode characters in python to display the unit W_rms.
However it seems the subscript "r" is different to the others:
I used the following codes:
>>> ...
0
votes
0
answers
458
views
encoding with 'idna' codec failed (UnicodeError: label empty or too long) Django send_mail
When sending a message to the mail via the send_mail function, an error appears - encoding with 'idna' codec failed (UnicodeError: label empty or too long)
What could be the problem and how to make ...
0
votes
1
answer
69
views
How can convert '\\u5de5' into '\u5de5'?
They are different:
len('\\u5de5')
6
len('\u5de5')
1
How can write a function to convert \\u5de5 into \u5de5?
def con_str(arg):
some_code_here
return result
con_str('\\u5de5')
\u5de5
0
votes
0
answers
17
views
How to Remove the Unicode Signature from while converting a file from CSV to JSON? [duplicate]
So, I tried converting a file from Kaggle which was in CSV to JSON.
Which made a new JSON file, but the first field of each object had the \ufeff Unicode signature.
Below mentioned is the code I used ...
0
votes
1
answer
96
views
schemaValidation error when using csv file with altair
I am using altair with python to visualise a map.
with open('cities.csv', encoding='utf-8') as f:
city = alt.Chart(f).mark_circle().encode(
latitude='latitude:Q',
longitude='longitude:Q',
...
0
votes
0
answers
47
views
Is it possible to create a 'class constructor with a unicode caracter' in python? [duplicate]
By 'class constructor with a unicode caracter' I mean an analogous to the list constructor '[' or the tuple constructor '('. For exemple, can I define a class Circular_List, a '|' constructor such ...
0
votes
1
answer
2k
views
'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte
I am having issues with my information retrieval code.
I am just trying to get information from txt files I have previously added to a corpus file. At first, everything was okay, the information that ...