Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer fails to be filled in win32 due to utf8 assertion #2

Open
frogonwheels opened this issue Feb 12, 2010 · 2 comments
Open

buffer fails to be filled in win32 due to utf8 assertion #2

frogonwheels opened this issue Feb 12, 2010 · 2 comments

Comments

@frogonwheels
Copy link

A utf8-validate assertion happens, and the buffer fails to be loaded.

@frogonwheels
Copy link
Author

Under win32, I get this warning message

c:\Apps\krig\gitage__init__.py:256: GtkWarning: gtk_text_buffer_emit_insert: as
sertion `g_utf8_validate (text, len, NULL)' failed

The very simplistic modification of Changing the set_text line to:
self.sourcebuffer.set_text(unicode(self.blamed.text,"iso-8859-1"))
seems to work under windows for standard files.

I have no real knowledge of python, so choosing the encoding in a more robust way would be an advantage (checking the bom marker - used a lot in windows - would allow distinguishing between utf8, ucs2-le ucs2-be encodings).
I'm thinking that a filesystem dependent default would be appropriate (iso-8859-1 or get the system encoding somehow for windows, utf8 otherwise).

@krig
Copy link
Owner

krig commented Mar 13, 2010

Hey, I committed a new version which simply does what you suggested on windows. Unfortunately I don't have a windows machine handy to test on, so I don't know if it actually works. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants