I use Vim and I copied the strings in a different place in the file and now it works. Could be that my Vim was configured differently before but I don't remember changin that. Or maybe I used another editor for some of it. I don't know. However I did notice that files minified using the yahoo javascript YUI compressor generate the same error. Also it was only a selected set of strings in each file, if the editor was the problem wouldn't it save everything in the same encoding ? Anyway I found a way to solve it so I'm good for now I guess. Tom
On Feb 16, 11:05 pm, "Diez B. Roggisch" <[email protected]> wrote: > Am 16.02.10 17:53, schrieb zaf: > > > > > Okay well here's a paste of JS code that fail : > >http://pastebin.com/m1e7207c6 > > > What's very weird, is that after some debugging,I realized line 10 > > failed but not the others and only one string in line 10 actually > > fails. > > > I did this to figure out the problem : (this is in turbogears/command/ > > i18n.py, line 483) > > > def _write_potfile_entries(self, potfile, messages): > > if messages: > > fd = open(potfile, 'at+') > > for linenumber, fname, text in messages: > > if text == '': > > continue > > print 'Original, ',type(text), text, fname, linenumber > > text = catalog.normalize(text.encode('utf-8')) > > fd.write('#: %s:%s\n' % (fname, linenumber)) > > fd.write('msgid %s\n' % text) > > fd.write('msgstr ""\n\n') > > fd.close() > > > and this is the output I get for line 10 : > > > Original,<type 'unicode'> cl (s) envoy e(s). cinego/static/ > > javascript/film.js 222 > > > Original,<type 'str'> Afficher le d tail cinego/static/javascript/ > > film.js 222 > > > I don't understand why one string would be typed as string and another > > as unicode. > > I'm guessing it's got to do with my typing of the strings but I really > > don't see what's wrong. > > Well, that's pretty simple: you saved them in some different encoding > than UTF-8. Which is required for the command to work (there might be > some parameter to determine the encoding, I don't remember that). > > And shuffling the files around might have convinced your editor to store > them as UTF-8 by accident. Whatever editor you use, you should try & > figure out how to convince it to save in utf-8 by default. > > Diez -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

