-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
utf-8 characters in bookmark titles cause fatal error #456
Comments
can you share the error example? |
Traceback (most recent call last): |
when you run this, does the exact error happened >>> import buku
>>> buku.print_single_rec((1, 'http://example.com', u'\u2013', ',tags1,', 'randomdesc', 0)) |
Please refer to this issue: jarun/googler#131 Confirm that your locale is UTF8 OR you are setting it to UTF8 when you run |
|
I'm still not clear, why are we talking about changing the locale on my machine? Why can buku not interpret utf8 internally? This should work out of the box. |
Did you try:
You can also set @zmwangx is there a way to detect and do this automatically? Would it even work? |
Yes, I already mentioned changing my local locale works, but this is not a real solution. No one that uses buku should be changing their machines locale. even temporarily. Buku should be able to detect this automatically or set it internally when run. This is what my submitted issue is about, it's not about setting my machines locale. |
Can you confirm if the following patch works? diff --git a/buku b/buku
index cb31612..17654a7 100755
--- a/buku
+++ b/buku
@@ -4211,6 +4211,8 @@ def print_single_rec(row, idx=0): # NOQA
try:
print(''.join(str_list))
+ except UnicodeEncodeError:
+ sys.stdout.buffer.write((''.join(str_list) + '\n').encode('utf-8'))
except BrokenPipeError:
sys.stdout = os.fdopen(1)
sys.exit(1) |
I've testing this and it works fine! |
@throwawayaccount0153 can you please confirm you don't see this issue again with commit a4ee497 ? Please respond in the ToDo list as this thread is auto-locked. |
Buku cannot interpret utf8 characters it seems, and currently system locale must be changed in order for buku to not fail fatally. Out of the box I should not have to change my locale in order for buku to work with utf8 symbols in bookmark titles. Bukubrow has no problem interpreting these characters, but buku errors out on the command line because of this, buku should be able to accomplish the same thing that bukubrow is doing without errors. I can switch my locale manually and this works, but no one should be switching their systems default locale, buku should be internally handling this because switching the default system locale breaks other programs. Because buku cannot handle utf-8 by itself, I cannot import some of my bookmarks and must continue to use the firefox bookmark system for those, which I would ideally completely abandon for full time buku usage.
tldr; Buku should handle utf-8 character interpretation internally, this functionality should not be offloaded to the system.
The text was updated successfully, but these errors were encountered: