Project

Profile

Help

Revision 96664dff

ID96664dff3695703aef396244b8f6fd34b5c46854
Parent 4102863f
Child ebe2010d

Added by Vincent Le Goff over 2 years ago

Fix the bug, but doesn't handle well other encodings yet

View differences:

settings/options.conf
1
# Text-to-speech configuration
1
# Text-to-speech configuration
2 2
[TTS]
3 3
    on = True
4 4
    outside = True
src/client.py
216 216
        encoding = settings["options.general.encoding"]
217 217
        if stacking:
218 218
            delimiter = re.escape(stacking)
219
            re_stacking = "(?<!{s}){s}(?!{s})".format(s=delimiter)
219
            re_stacking = u"(?<!{s}){s}(?!{s})".format(s=delimiter)
220 220
            re_del = re.compile(re_stacking, re.UNICODE)
221 221
            chunks = re_del.split(text)
222 222

  
src/config.py
142 142
                os.mkdir(base)
143 143

  
144 144
        # Create the ConfigObj
145
        config = ConfigObj(fullpath + ".conf", configspec=spec.split("\n"))
145
        config = ConfigObj(fullpath + ".conf", encoding="latin-1",
146
                configspec=spec.split("\n"))
146 147

  
147 148
        # Validates the configuration
148 149
        validator = Validator()
src/world.py
152 152
        """).strip("\n")
153 153

  
154 154
        if self.settings is None:
155
            self.settings = ConfigObj(spec.split("\n"))
155
            self.settings = ConfigObj(spec.split("\n"), encoding="latin-1")
156 156

  
157 157
        connection = self.settings["connection"]
158 158
        connection["name"] = self.name
......
330 330
    @classmethod
331 331
    def get_infos(cls, configuration):
332 332
        """Get the information in the configuration and return a dict."""
333
        config = ConfigObj(StringIO(configuration))
333
        config = ConfigObj(StringIO(configuration), encoding="latin-1")
334 334
        data = {}
335 335

  
336 336
        for key, value in config.items():

Also available in: Unified diff