Support UTF8 in provider.json
By definition, JSON files are UTF8. I think this provider.json file has correct UTF8 encoding of the accents:
https://colnodo.org/provider.json
For example:
"Colnodo es una organización sin fines de lucro establecida en Colombia que provee servicios de Internet para el Desarrollo"
However, once this is saved to .config/leap/providers/colnodo.org/provider.json, it gets saved as:
"Colnodo es una organizaci\u00f3n sin fines de lucro establecida en Colombia que provee servicios de Internet para el Desarrollo."
Also, this error appears when the wizard is run:
File "/usr/lib/python2.7/dist-packages/leap/bitmask/gui/wizard.py", line 737, in _current_id_changed description = "{0}".format(details['description']) UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 25: ordinal not in range(128)If I try to start bitmask, I get this:[2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/threading.py", line 783, in __bootstrap [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - self.__bootstrap_inner() [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - self.run() [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/threading.py", line 763, in run [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - self.__target(*self.__args, **self.__kwargs) [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 196, in _worker [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - result = context.call(ctx, function, *args, **kwargs) [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - return self.currentContext().callWithContext(ctx, func, *args, **kw) [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - return func(*args,**kw) [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/leap/bitmask/backend/backend.py", line 229, in [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - method = lambda: func(**kwargs) [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/leap/bitmask/backend/leapbackend.py", line 298, in eip_can_start [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - self._eip.can_start(domain) [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/leap/bitmask/backend/components.py", line 695, in can_start [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - if self._can_start(domain): [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/leap/bitmask/backend/components.py", line 655, in _can_start [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - eip_loaded = eip_config.load(eipconfig.get_eipconfig_path(domain)) [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/leap/common/config/baseconfig.py", line 174, in load [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - self._config_checker.load(fromfile=config_path, mtime=mtime) [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/leap/common/config/pluggableconfig.py", line 446, in load [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - content = self.deserialize(fromfile=fromfile) [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - File "/usr/lib/python2.7/dist-packages/leap/common/config/pluggableconfig.py", line 390, in deserialize [2016-01-04 23:01:47] ERROR - L#45 : leap.common.check:leap_assert - leap_assert(os.path.exists(fromfile)) [2016-01-04 23:01:47] ERROR - L#179 : leap.common.config.baseconfig:load - Something went wrong while loading the config from /home/elijah/.config/leap/providers/colnodo.org/eip-service.jsonRemoving the offending character from /home/elijah/.config/leap/providers/colnodo.org/eip-service.json makes it work again.
(from redmine: created on 2016-01-04)