Kodi Community Forum

Full Version: Formating menu text
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I need some help with formating text.

In my old addon it was written like this:
AddDir("[COLOR yellow][b]{0}[/b][/COLOR]".format(getLocaleString(30001)), "newList" , 20, os.path.join(iconsDir, "NewList.ico"), isFolder=False)

The color is good but the problem is with the bold tags, it shows it like this:
How can I fix this? in Kodi 17.6 it was ok.
Thanks.
Image
I found the problem, it was because the encoding issue in the getLocaleString function

Code:
def getLocaleString(id):
    return Addon.getLocalizedString(id).encode('utf-8')

After remove the .encode('utf-8'), it's ok now

Code:
def getLocaleString(id):
    return Addon.getLocalizedString(id)