cp1252

Preserving special characters when writing to a CSV – What encoding to use?

Preserving special characters when writing to a CSV – What encoding to use? Question: I am trying to save the string the United Nations’ Sustainable Development Goals (SDGs) into a csv. If I use utf-8 as the encoding, the apostrophe in the string gets converted to an ASCII char import csv str_ = "the United …

Total answers: 1

Convert non UTF-8 ASCII literals in otherwise UTF-8 text to their respective character

Convert non UTF-8 ASCII literals in otherwise UTF-8 text to their respective character Question: I have a UTF8 encoded text that has been mangled and contains some ‘cp1252’ ASCII literals. I am trying to isolate the literals and convert them one by one, however following code does not work and I can’t understand why… text …

Total answers: 1

Correctly reading text from Windows-1252(cp1252) file in python

Correctly reading text from Windows-1252(cp1252) file in python Question: so okay, as the title suggests the problem I have is with correctly reading input from a windows-1252 encoded file in python and inserting said input into SQLAlchemy-MySql table. The current system setup: Windows 7 VM with “Roger Access Control System” which outputs the file; Ubuntu …

Total answers: 3