I have a question...I'm trying to get text out of a website containing Spanish characters (like ñ or á) using urllib2 (and with #-*- coding: latin-1 -*- near the beginning of the Python file). However, when I write the output of the text to a file, I get something else--for example, ñ appears as ñ (so español appears as español). Even if I manually put in a line that says something like letter="ñ" and print it to the screen, it appears as ±. Any advice? As I mentioned in the title, I'm using Python 2.7 on Windows 7 (though I get the same output in a file in Ubuntu). Thanks in advance!
hokeysmoke 0 Newbie Poster
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
hokeysmoke 0 Newbie Poster
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
M.S. 53 Light Poster
hokeysmoke 0 Newbie Poster
hokeysmoke 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.