Hello,
like Kleriker, I am not able to get special chars working with the advanced webserver.
As I saw this post, I thought it was time to test a little bit more.
It still don't work, here is what I have tested :
I have created 3 text files with Notepad++ :
ansi.html : format is set to ansi in np++
utf8.html : format is set to utf8 (without BOM) in np++
utf82.html : format is set to utf8 in np++
the content of these 3 files is identical and very simple, just 2 lines, no ref to python vars :
EG Log with ansi.html :
Code: Select all
2011-01-06 10:28:00 Webserver socket error /ansi.html
2011-01-06 10:28:00 <type 'exceptions.Exception'> ('utf8', 'test\r\nt\xe9st', 7, 10, 'invalid data')
2011-01-06 10:28:00 ----------------------------------------
2011-01-06 10:28:00 Exception happened during processing of request from ('127.0.0.1', 2676)
2011-01-06 10:28:00 Traceback (most recent call last):
2011-01-06 10:28:00 File "SocketServer.pyc", line 558, in process_request_thread
2011-01-06 10:28:00 File "SocketServer.pyc", line 320, in finish_request
2011-01-06 10:28:00 File "SocketServer.pyc", line 615, in __init__
2011-01-06 10:28:00 File "BaseHTTPServer.pyc", line 329, in handle
2011-01-06 10:28:00 File "BaseHTTPServer.pyc", line 323, in handle_one_request
2011-01-06 10:28:00 File "C:\Program Files\EventGhost\plugins\Webserver\__init__.py", line 194, in do_GET
2011-01-06 10:28:00 File "C:\Program Files\EventGhost\plugins\Webserver\__init__.py", line 149, in SendContent
2011-01-06 10:28:00 File "jinja2\environment.pyc", line 552, in get_template
2011-01-06 10:28:00 File "jinja2\loaders.pyc", line 96, in load
2011-01-06 10:28:00 File "C:\Program Files\EventGhost\plugins\Webserver\__init__.py", line 69, in get_source
2011-01-06 10:28:00 File "encodings\utf_8.pyc", line 16, in decode
2011-01-06 10:28:00 UnicodeDecodeError: 'utf8' codec can't decode bytes in position 7-9: invalid data
2011-01-06 10:28:00 ----------------------------------------
EG Log with utf8.html :
Code: Select all
2011-01-06 10:30:25 Webserver socket error /utf8.html
2011-01-06 10:30:25 <type 'exceptions.Exception'> ('ascii', u'test\nt\xe9st', 6, 7, 'ordinal not in range(128)')
2011-01-06 10:30:25 ----------------------------------------
2011-01-06 10:30:25 Exception happened during processing of request from ('127.0.0.1', 2701)
2011-01-06 10:30:25 Traceback (most recent call last):
2011-01-06 10:30:25 File "SocketServer.pyc", line 558, in process_request_thread
2011-01-06 10:30:25 File "SocketServer.pyc", line 320, in finish_request
2011-01-06 10:30:25 File "SocketServer.pyc", line 615, in __init__
2011-01-06 10:30:25 File "BaseHTTPServer.pyc", line 329, in handle
2011-01-06 10:30:25 File "BaseHTTPServer.pyc", line 323, in handle_one_request
2011-01-06 10:30:25 File "C:\Program Files\EventGhost\plugins\Webserver\__init__.py", line 194, in do_GET
2011-01-06 10:30:25 File "C:\Program Files\EventGhost\plugins\Webserver\__init__.py", line 160, in SendContent
2011-01-06 10:30:25 File "socket.pyc", line 292, in write
2011-01-06 10:30:25 UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 6: ordinal not in range(128)
2011-01-06 10:30:25 ----------------------------------------
EG Log with utf82.html :
Code: Select all
2011-01-06 10:32:33 Webserver socket error /utf82.html
2011-01-06 10:32:33 <type 'exceptions.Exception'> ('ascii', u'\ufefftest\nt\xe9st', 0, 1, 'ordinal not in range(128)')
2011-01-06 10:32:33 ----------------------------------------
2011-01-06 10:32:33 Exception happened during processing of request from ('127.0.0.1', 2706)
2011-01-06 10:32:33 Traceback (most recent call last):
2011-01-06 10:32:33 File "SocketServer.pyc", line 558, in process_request_thread
2011-01-06 10:32:33 File "SocketServer.pyc", line 320, in finish_request
2011-01-06 10:32:33 File "SocketServer.pyc", line 615, in __init__
2011-01-06 10:32:33 File "BaseHTTPServer.pyc", line 329, in handle
2011-01-06 10:32:33 File "BaseHTTPServer.pyc", line 323, in handle_one_request
2011-01-06 10:32:33 File "C:\Program Files\EventGhost\plugins\Webserver\__init__.py", line 194, in do_GET
2011-01-06 10:32:33 File "C:\Program Files\EventGhost\plugins\Webserver\__init__.py", line 160, in SendContent
2011-01-06 10:32:33 File "socket.pyc", line 292, in write
2011-01-06 10:32:33 UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in position 0: ordinal not in range(128)
2011-01-06 10:32:33 ----------------------------------------
I don't know what this really means, I will try to search more, let me know if you have ideas !
Regards