Close

Fixed Unicode Strings not Displaying Correctly

A project log for Juliet Magic Mirror

An IoT device that displays the weather, news, time, and can play music: all on a beautiful, clean interface

matt-lagarenneMatt Lagarenne 02/23/2016 at 01:590 Comments

Fixed the code not displaying unicode strings correctly in python 2.7, at least for the weather-module. In this case, the fix was to use the line

from __future__ import unicode_literals

at the beginning near the rest of the imports. This tells python to use unicode as the default encoding scheme for the strings in the file. If not used, the icon text is rendered as a bunch of "icon not found" boxes.

Discussions