Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix loading on non-ascii profile paths (windows) #1

Merged
merged 1 commit into from

2 participants

@chadoe

xbmc.translatePath returns an utf-8 string, windows filesystem isn't utf-8 so it was adding a path with the incorrect encoding to the system path without converting it first and was unable to load (import utilities) because the (mangled) path couldn't be found. That is for people having non-ascii characters in their profile path.

@chadoe chadoe decode utf-8 paths to internal encoding otherwise the addon fails to …
…load on windows with non-ascii profile paths like G:\XBMC\íö.
4648130
@amet
Owner

coll, then this should be a default way to do it on all addons :)

@amet
Owner

thx a lot!!

@amet amet merged commit 82cb5cc into amet:master
@chadoe

any addon using paths like that should do that yes, most users won't have non-ascii characters in their xbmc/profile paths but those that do will get errors without it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2012
  1. @chadoe

    decode utf-8 paths to internal encoding otherwise the addon fails to …

    chadoe authored
    …load on windows with non-ascii profile paths like G:\XBMC\íö.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 weather.worldweatheronline/default.py
View
4 weather.worldweatheronline/default.py
@@ -29,8 +29,8 @@
__author__ = __addon__.getAddonInfo('author')
__language__ = __addon__.getLocalizedString
-__profile__ = xbmc.translatePath( __addon__.getAddonInfo('profile') )
-__resource__ = xbmc.translatePath( os.path.join( __cwd__, 'resources', 'lib' ) )
+__profile__ = xbmc.translatePath( __addon__.getAddonInfo('profile') ).decode("utf-8")
+__resource__ = xbmc.translatePath( os.path.join( __cwd__, 'resources', 'lib' ) ).decode("utf-8")
sys.path.append (__resource__)
Something went wrong with that request. Please try again.