-
Notifications
You must be signed in to change notification settings - Fork 24
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
German Umlauts break search #18
Comments
[21/Nov/2012:08:02:55] HTTP Traceback (most recent call last): [21/Nov/2012:08:02:55] HTTP [21/Nov/2012:08:03:01] HTTP [21/Nov/2012:08:03:08] HTTP [21/Nov/2012:08:03:45] HTTP |
btw: in the browse-list, the Umlaut looks like an utf character (double byte) |
Hi Matthias, I did a small test writing a file named "ö.txt" in the share directory. http://127.0.0.1:12555/q/?v=%C3%B6 I didn't get the same exception. Could you start a Python on the server and check import sys
print sys.getdefaultencoding() Just to be sure. |
root@rPt4WCYo:/# python
|
I found the issue(s) but I'm currently struggling how to fix it properly, the issue is from the incoming value from the filename (encoded in UTF-8) but the default codec in Python (for forban_share - line 243->250) is usually ascii and then I tested with some ".decode("utf-8").encode("latin-1")" but it doesn't work in a consistent among the Python version and especially regarding the site configuration of the encoding. If you have any ideas, let me know. I'll check some other ideas. |
Is it possible to redefine the default encoding around decoding base64 and turn it back to ascii later? I learned a few things in my System-Administration and Userhelp on IBM Websphere MQ about all this sh**** encoding stuff: You have to know which encoding enters your system and what you use inside (i.e. during modification). The complete platform independend steps should be something like this:
If the normal base64.decode can't handle this well, you may try this library for encode and decode: http://docs.python.org/2.7/library/binascii.html?highlight=binascii#binascii In a short overview it looks like an "convert any byte-array to hex" functionality. This should work like the default base64 function... with the flaw you have to convert back to string again. |
Thanks for the feedback. That's exactly the step 4 that is an issue. The base64 modules of Python is also relying on the binascii module. I'll give another try. |
Hi, :( |
Try this: Add the following lines to your app config.
|
Yep, I tried sometime ago but the result is variable depending of the Python 2 version and the platform where it's running. I'll build a set of test case to see where the origin of the issue is. Thank you. |
Hi,
on a remote system, I have a file with a "ö".
This causes to break the search on every connected forban.
Browsing works.
Error in forbarn_share_error.log:
--- will included soon ---
Any idea?
Matthias
The text was updated successfully, but these errors were encountered: