'How do you print accented characters?

I want to write a program that takes text from a file and prints the selected lines. When printing a word containing an accented character like "ó", I get "Ã-". I'm just trying to print the word with that accented "ó" to print as it is. So just to clarify I'm trying to take "ó" and have it print as "ó". The answer is in the comments.



Solution 1:[1]

Have you tried adding something like this to the beginning of your code?

#!/usr/bin/env python
# -*- coding: utf-8 -*-

Try this thread also, maybe you find answers there: Correct way to define Python source code encoding

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Paraskevee