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

'ascii' codec can't encode character '\u2014' #30

Closed
ghost opened this issue May 28, 2016 · 5 comments
Closed

'ascii' codec can't encode character '\u2014' #30

ghost opened this issue May 28, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented May 28, 2016

Hello,
When I add bookmarks, sometimes I get this error, and the entry is invalid

$ buku -a https://medium.com/@Spurrya/20-pcb-tips-and-tricks-47b95a4ba706#.4ksvpq9hi
297. https://medium.com/@Spurrya/20-pcb-tips-and-tricks-47b95a4ba706#.4ksvpq9hi
EXCEPTION [add_bookmark]: (UnicodeEncodeError) 'ascii' codec can't encode character '\u2014' in position 37: ordinal not in range(128)
dstoica@pentoo ~ $

$ buku -s ''
297. https://medium.com/@Spurrya/20-pcb-tips-and-tricks-47b95a4ba706#.4ksvpq9hi [297]
Traceback (most recent call last):
File "/usr/local/bin/buku", line 1466, in
bdb.searchdb(args.sany, False, jsonOutput)
File "/usr/local/bin/buku", line 402, in searchdb
prompt(results)
File "/usr/local/bin/buku", line 891, in prompt
print_record(row, count)
File "/usr/local/bin/buku", line 931, in print_record
print(' \x1B[91m>\x1B[0m %s' % row[2])
UnicodeEncodeError: 'ascii' codec can't encode character '\u2014' in position 37: ordinal not in range(128)

@jarun
Copy link
Owner

jarun commented May 28, 2016

Works fine for me:

$ buku -a https://medium.com/@Spurrya/20-pcb-tips-and-tricks-47b95a4ba706#.4ksvpq9hi
336. https://medium.com/@Spurrya/20-pcb-tips-and-tricks-47b95a4ba706#.4ksvpq9hi
   > Few PCB schematic tips — Medium

Which version are you using? What's your terminal emulator?

@jarun
Copy link
Owner

jarun commented May 28, 2016

Tested successfully with AltYo, Terminator, xfce4-terminal, xterm.

@ghost
Copy link
Author

ghost commented May 28, 2016

It seems it was a locale issue.
Setting locale to en_US.utf8 has fixed the problem
The result is now:
297. https://medium.com/@Spurrya/20-pcb-tips-and-tricks-47b95a4ba706#.4ksvpq9hi [297]

Few PCB schematic tips ��� Medium

Thanks

@jarun
Copy link
Owner

jarun commented May 28, 2016

Thank you for confirming!

@Chinggis6
Copy link

Chinggis6 commented Nov 19, 2017

for archlinux it was localectl set-locale LANG=en_US.UTF-8, and a reboot after (sadly)

@github-actions github-actions bot locked and limited conversation to collaborators Jun 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants