diff --git a/gluon/html.py b/gluon/html.py
index 0909290c..c5bf255e 100644
--- a/gluon/html.py
+++ b/gluon/html.py
@@ -34,7 +34,7 @@ join = ''.join
# name2codepoint is incomplete respect to xhtml (and xml): 'apos' is missing.
entitydefs = dict(map(lambda (k,v): (k, unichr(v).encode('utf-8')), name2codepoint.iteritems()))
-entitydefs.setdefault('apos', u"'")
+entitydefs.setdefault('apos', u"'".encode('utf-8'))
__all__ = [