-
Notifications
You must be signed in to change notification settings - Fork 2.3k
popups allow unicode #95
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
Conversation
|
Hi @apatil we need to be smarter about this to ensure py3k compatibility. Also, we will probably need something like: 'fancy string/unicode'.encode('ascii', 'xmlcharrefreplace')To get a proper HTML representation. Are you up to implement this? If not, can you open an issue and reference this PR? |
folium/folium.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
isinstance(popup, (str, unicode))instead.
|
Hi @ocefpaf, that's a good test suite. :) I'll give it a shot later today. |
|
How does that look, @ocefpaf? |
|
Looking great @apatil! As a folium maintainer and a non-English speaker Thanks for doing this!! I will review/test it and merge ASAP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apatil I am on the fence here. I am not sure if the call to str is necessary, but it does not hurt... What is your argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was getting type errors in python3 without it. The encode('ascii', ...) produces a bytes object, which json.dumps doesn't like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
str it is then.
|
@ocefpaf sorry for the delay and the extra commit, but it's mostly squashed. :) |
|
Nice! Thanks for sending another very useful PR! |
|
My pleasure. :) |
Hi @ocefpaf, another small one. This allows unicode titles on popups.