formatters: use locale.getpreferredencoding() instead of utf-8
Signed-off-by: Matthieu Weber <mweber+weboob@free.fr> Signed-off-by: Romain Bignon <romain@symlink.me>
This commit is contained in:
parent
1ca881e270
commit
95cd12fd22
2 changed files with 5 additions and 3 deletions
|
|
@ -17,6 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import locale
|
||||
|
||||
from prettytable import PrettyTable
|
||||
|
||||
|
|
@ -40,7 +41,7 @@ class TableFormatter(IFormatter):
|
|||
def flush(self):
|
||||
s = self.get_formatted_table()
|
||||
if s is not None:
|
||||
self.output(s.encode('utf-8'))
|
||||
self.output(s.encode(locale.getpreferredencoding(), errors='replace'))
|
||||
|
||||
def get_formatted_table(self):
|
||||
if len(self.queue) == 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue