So UTF-8 files are rendered correctly.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
# Write a string to the connection
redef fun write(str)
do
- native_buffer_event.write(str.to_cstring, str.length)
+ native_buffer_event.write(str.to_cstring, str.bytelen)
end
redef fun write_byte(byte) do native_buffer_event.write_byte(byte)
do
# Set the content length if not already set
if not header.keys.has("Content-Length") then
- header["Content-Length"] = body.length.to_s
+ header["Content-Length"] = body.bytelen.to_s
end
# Set server ID