Questions tagged [latin1]

Latin1 - ISO-8859-1.

A character set defines the way a sequence of bytes is converted into a sequence of characters. This particular character set is known as Latin-1, or ISO-8859-1. Of the 256 characters in Latin-1, 128 are the characters in the ASCII, the characters that typically appear on a standard U.S. English keyboard (and accompanying nonprinting special characters such as ASCII BEL). The remaining 128 consist of special and accented characters that are used regularly in the Western European languages.

To specify these characters in an HTML document (or on StackExchange), you can enter the character entity (if one is defined) or the numeric entity. For example, to cause Æ to appear in a document, you could enter either Æ or &#198. Note that the case of character entities is significant. Specifying æ causes æ to be displayed.

231 questions
8
votes
1 answer

Writing and then reading a string in file encoded in latin1

Here are 2 code samples, Python3 : the first one writes two files with latin1 encoding : s='On écrit ça dans un fichier.' with open('spam1.txt', 'w',encoding='ISO-8859-1') as f: print(s, file=f) with open('spam2.txt', 'w',encoding='ISO-8859-1')…
7
votes
1 answer

no_translation error while attempting to write unicode characters to file in Elixir

I have a stream that I'm reading from and in turn am writing to a file however I am getting an error that is caused by the presence of a ’. I assume this is because I'm opening the file w/ the wrong encoding or something but I don't know how to…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
7
votes
1 answer

UTF-8 data in Latin1 database: can it be saved?

I have a rails app that receives data from an Android device. I noticed that some of the data, when in Japanese, is not saved correctly. It shows up as literal question marks (not the diamond ones) in the MySQL client and in the rails website. It…
Peterdk
  • 15,625
  • 20
  • 101
  • 140
6
votes
1 answer

Convert QString into QByteArray with either UTF-8 or Latin1 encoding

I would like to covert a QString into either a utf8 or a latin1 QByteArray, but today I get everything as utf8. And I am testing this with some char in the higher segment of latin1 higher than 0x7f, where the german ü is a good example. If I do…
Johan
  • 20,067
  • 28
  • 92
  • 110
6
votes
1 answer

How to read a binary file with FileReader in order to hash it with SHA-256 in CryptoJS?

how do I convert a UTF-8 string to Latin1 encoded string using javascript? Here is what I am trying to do: I get a file, split that in chunks by reading as arraybuffer then, I parse the arraybuffer as string and passing it to cryptoJS for hash…
learnedOne
  • 143
  • 2
  • 11
6
votes
3 answers

Python 3 chokes on CP-1252/ANSI reading

I'm working on a series of parsers where I get a bunch of tracebacks from my unit tests like: File "c:\Python31\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError:…
Aaron Altman
  • 1,705
  • 1
  • 14
  • 22
6
votes
1 answer

latin-1 vs unicode in python

I was reading this high rated post in SO on unicodes Here is an `illustration given there : $ python >>> import sys >>> print sys.stdout.encoding UTF-8 >>> print '\xe9' # (1) é >>> print u'\xe9' # (2) é >>> print u'\xe9'.encode('latin-1') #…
eagertoLearn
  • 9,772
  • 23
  • 80
  • 122
6
votes
2 answers

mysqldump exporting data in a bad character set

Yesterday for the first time I exported my Mysql database and I found some very strange characters in the dump such as: INSERT INTO `piwik_archive_blob_2013_01` VALUES (15,'Actions_actions_url_6',1,'2013-01-17','2013-01-17',1,'2013-01-20…
user2149321
6
votes
3 answers

How to convert a String from UTF8 to Latin1 in C/C++?

The question I have is quite simple, but I couldn't find a solution so far: How can I convert a UTF8 encoded string to a latin1 encoded string in C++ without using any extra libs like libiconv? Every example I could find so far is for latin1 to UTF8…
ashiaka
  • 3,994
  • 8
  • 32
  • 45
6
votes
1 answer

PHP MySQL using Latin1(iso-8859-1) despite UTF-8 settings

Once again I have a weird and tricky problem. I've been working with converting my MySQL databases (and everything else on my server for that matter) to UTF-8 to avoid having to convert text when getting and putting text into the different…
user1571510
  • 113
  • 2
  • 8
5
votes
1 answer

Convert Between Latin1-encoded Data.ByteString and Data.Text

Since the latin-1 (aka ISO-8859-1) character set is embedded in the Unicode character set as its lowest 256 code-points, I'd expect the conversion to be trivial, but I didn't see any latin-1 encoding conversion functions in Data.Text.Encoding which…
hvr
  • 7,775
  • 3
  • 33
  • 47
5
votes
4 answers

How do I convert a column to ASCII on the fly without saving to check for matches with an external ASCII string?

I have a member search function where you can give parts of names and the return should be all members having at least one of username, firstname or lastname matching that input. The problem here is that some names have 'weird' characters like the é…
Rudie
  • 52,220
  • 42
  • 131
  • 173
5
votes
1 answer

inserting latin1-encoded text into utf8 tables (forgot to use mysql_set_charset)

I have a PHP web app with MySQL tables taking utf8 text. I recently converted the data from latin1 to utf8 along with the tables and columns accordingly. I did, however, forget to use mysql_set_charset and the latest incoming data I would assume…
scootklein
  • 708
  • 1
  • 8
  • 21
5
votes
2 answers

UnicodeDecodeError: 'ascii' codec can't decode byte in position : ordinal not in range(128)

I have done a bit of research on this error and can't really get my head around what's going on. As far as I understand I am basically having problems because I am converting from one type of encoding to another. def write_table_to_file(table,…
Justin S
  • 1,409
  • 4
  • 22
  • 38
5
votes
3 answers

NodeJS decodeURIComponent not working properly

When I tryed to decode the string below in nodeJS using decodeURLCompnent: var decoded = decodeURI('Ulysses%20Guimar%C3%A3es%20-%20lado%20par'); console.log(decoded); I got Ulysses Guimarães - lado par Instead of Avenida Ulysses Guimarães - lado…
nanndoj
  • 6,580
  • 7
  • 30
  • 42
1
2
3
15 16