Closed Draiken closed 8 years ago
Thanks for your time on debugging. Since many languages use non-ascII letters, I believe uniformly use utf-8 string in our plugin is better. If strftime
is known to cause issues when using decoded string. I think we should wrap it around like you did. Feeding it encoded string then decode the returned string back.
If your solution already works, mind sending in a pull request?
I'll create separate pull requests for a few fixes I did:
On Fri, May 6, 2016, 12:31 AM HE Chong notifications@github.com wrote:
Thanks for your time on debugging. Since many languages use non-ascII letters, I believe uniformly use utf-8 string in our plugin is better. If strftime is known to cause issues when using decoded string. I think we should wrap it around like you did. Feeding it encoded string then decode the returned string back.
If your solution already works, mind sending in a pull request?
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/jceb/vim-orgmode/issues/230#issuecomment-217340211
Pull request merged.
Hi there!
I started using the plugin and soon got an error when attempting to get a week agenda view. The vim calendar dates are generated in my locale (pt_BR in this case) so saturday string representation is "Sáb"
This caused errors on the highlighting (didn't recognize as a date) and didn't pick up those dates on the agenda view.
My first attempts were to just change the string to "Sat" for example, but that didn't help. Upon further investigation I found the problem. When using
strftime
on theOrgDate
classes it does not support utf-8 strings on date representations. I'm not a python expert so googling around apparently this is a known issue from some standard libraries.I have managed to build a failing test and solution specifically my agenda view. But I suspect this problem would creep up anywhere where
strftime
is used.Here is the error trace:
Here is the failing test: https://gist.github.com/Draiken/6c8cfe330d2280d11fd68260c83b7cd2 Of course, this requires the utf8 locale to be installed on the base system... which is not great at all.
The solution I tried was to convert the format to utf-8 then decode it back again. This is on the
OrgDate
class. This made the test passI'm neither a python programmer or familiar with the orgmode codebase but I'd be glad to build a pull request if you can point me in the right direction.
I see two solutions:
Thanks!