Bottle 0.13-dev
Firefox 26.0
Ich habe eine statische HTML Seite via bottle/static_file und via Firefox/<File>/<Open File> anzeigen lassen.
Die Umlaute der HTML Seite wurde bei der Anzeige via Firefox/<File>/<Open File> im Firefox korrekt angezeigt.
Die Umlaute der HTML Seite wurden bei der Anzeige via bottle/static_file im gleichen Firefox nicht angezeigt.
Die Lösung für die Variante bottle/static_file war das Einfügen von < mimetype='content type' > im Kommando
<return static_file(.....)> :
Diese Version zeigt die Umlaute der statischen HTML Seite /home/stefan/Ubuntu One/Programming/css/<filename>
korrekt an:
Code: Alles auswählen
@route('/<filename:path>')
def send_static(filename):
return static_file(filename, root='/home/stefan/Ubuntu One/Programming/css', mimetype='content type')
nicht korrekt an, da <mimetype='content type'> fehlt:
Code: Alles auswählen
@route('/<filename:path>')
def send_static(filename):
return static_file(filename, root='/home/stefan/Ubuntu One/Programming/css')
in bottle/static_file erfolgt ? Ist das ein Bug von bottle/static_file oder ein Bug der statischen HTML Seite oder von beiden ?
Anhang:
Das bottle Skript:
Code: Alles auswählen
#!/usr/bin/python
# -*- coding: utf-8 -*-
from bottle import route, run, template, debug, static_file, response
@route('/<filename:path>')
def send_static(filename):
return static_file(filename, root='/home/stefan/Ubuntu One/Programming/css', mimetype='content type')
# debuging - do not use it in production environments
#
debug(True)
# reloader=True - automatically detect changes to the script
# and reload new version once it is called again
# Do not use it in production environments
run(host='localhost', port=8080, reloader=True)
(..)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Meine erste Überschrift</title>
</head>
<body id="startseite">
<div id="wrapper">
<!-- im Browser sichtbarer Teil -->
<div id="kopfzeile">
<img src="logo.png" alt="Logo" width="80" height="80" />
</div>
...
(..)