character-encoding

Strange tabs-names characters in Eclipse IDE

烂漫一生 提交于 2021-02-11 14:40:44
问题 I am getting strange tabs-names characters in Eclipse IDE. (Operating system - Win10x64. Software - Eclipse x64 for java developers) Buggy tabs: Correct in the pop-up window: What may be the problem? 回答1: This is suggested by greg-449. The issue is described here. I have set every font (I don't know witch is required) as consolas and it worked for me. 来源: https://stackoverflow.com/questions/63151885/strange-tabs-names-characters-in-eclipse-ide

Encoding mismatch in connection and Python

China☆狼群 提交于 2021-02-11 14:38:36
问题 I am having some troubles getting my Firebird connection to work, and it all seems related to encodings. I am connecting to the database like this ( local_copy is /path/to/database.fdb ): conn = fdb.connect(dsn=local_copy, user='****', password='****', charset="ISO8859_1") which only works for certain charsets. I need to have the ISO8859_1 charset, which worked before, but not anymore (perhaps because of an update). Traceback (most recent call last): File "sync.py", line 10, in <module> conn

How do I configure a terminal to read UTF-8 characters?

安稳与你 提交于 2021-02-11 14:26:32
问题 I am working on a project which accepts user input via the command line. I am using up-to-date Windows 10 and (after much running around in circles...) I am aware that it is notoriously bad when it comes to handling UTF-8 characters. Consequently, I looked to VS Code and the integrated terminal (PowerShell) to perform input into the program. Sadly, the terminal seemed unable to accept accented UTF-8 characters such as "ë". I then did more research and configured the settings.json for VS Code

How to decode unicode string that is read from a file in Python?

烈酒焚心 提交于 2021-02-11 13:22:31
问题 I have a file containing UTF-16 strings. When I try to read the unicode, " " (double quotes) are added and the string looks like "b'\\xff\\xfeA\\x00'" . The inbuilt .decode function throws a AttributeError: 'str' object has no attribute 'decode' . I tried a few options but those didn't work. This is what the file I am reading from looks like 回答1: Try this: str.encode().decode() 回答2: It looks like the file has been created by writing bytes literals to it, something like this: some_bytes = b

How to decode unicode string that is read from a file in Python?

…衆ロ難τιáo~ 提交于 2021-02-11 13:21:35
问题 I have a file containing UTF-16 strings. When I try to read the unicode, " " (double quotes) are added and the string looks like "b'\\xff\\xfeA\\x00'" . The inbuilt .decode function throws a AttributeError: 'str' object has no attribute 'decode' . I tried a few options but those didn't work. This is what the file I am reading from looks like 回答1: Try this: str.encode().decode() 回答2: It looks like the file has been created by writing bytes literals to it, something like this: some_bytes = b

Python3 different behaviour between latin-1 and cp1252 when decoding unmapped characters

老子叫甜甜 提交于 2021-02-10 16:59:59
问题 I'm trying to read in Python3 a text file specifying encoding cp1252 which has unmapped characters (for instance byte 0x8d ). with open(inputfilename, mode='r', encoding='cp1252') as inputfile: print(inputfile.readlines()) I obviously get the following exception: Traceback (most recent call last): File "test.py", line 9, in <module> print(inputfile.readlines()) File "/usr/lib/python3.6/encodings/cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0]

Python3 different behaviour between latin-1 and cp1252 when decoding unmapped characters

拥有回忆 提交于 2021-02-10 16:59:33
问题 I'm trying to read in Python3 a text file specifying encoding cp1252 which has unmapped characters (for instance byte 0x8d ). with open(inputfilename, mode='r', encoding='cp1252') as inputfile: print(inputfile.readlines()) I obviously get the following exception: Traceback (most recent call last): File "test.py", line 9, in <module> print(inputfile.readlines()) File "/usr/lib/python3.6/encodings/cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0]

write unicode data to mssql with python?

前提是你 提交于 2021-02-10 15:50:14
问题 I'm trying to write a table from a .csv file with Hebrew text in it to an sql server database. the table is valid and pandas reads the data correct (even displays the hebrew properly in pycharm), but when i try to write it to a table in the database i get question marks ( "???" ) where the Hebrew should be. this is what i've tried, using pandas and sqlalchemy: import pandas as pd from sqlalchemy import create_engine engine = create_engine('mssql+pymssql://server/test?charset=utf8') connection

How to change default character encoding for Python IDLE?

荒凉一梦 提交于 2021-02-10 14:42:10
问题 I'm using Python 3.6 on Windows. When I run a script using the standard Windows shell ( cmd.exe ), the default text encoding for stdin/stdout is 'utf-8' as expected in Python 3.x: python -c "import sys; print(sys.stdout.encoding)" utf-8 However, the same command on the IDLE shell leads to a different result, which is clearly annoying, especially for beginner students using IDLE as a first step IDE >>> import sys; print(sys.stdout.encoding) cp1252 It happens that IDLE defines PseudoOutputFile

What character encoding is this?

╄→гoц情女王★ 提交于 2021-02-10 13:24:53
问题 I'm interfacing with an Oracle DB, which has some messed up encoding (ASCII7 according to the db properties, but actually encodes Korean characters). When I get some of the Korean strings from the resultSet, and look at the bytes, it turns out that they correspond exactly to this file (I found by googling some of the byte sequences): http://211.115.85.9/files/raw3.txt Kinda spooky, as it seems to be the ONLY thing on the internet that has anything about this particular encoding... The file,