diff --git a/inc/common.php b/inc/common.php
index 6f3cad2e488aae2daafb3ed0479771229275cf91..8af63002cec86df10191b275fb7b931f5f4237f3 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -20,6 +20,28 @@ define('RECENTS_SKIP_DELETED',2);
 define('RECENTS_SKIP_MINORS',4);
 define('RECENTS_SKIP_SUBSPACES',8);
 
+/**
+ * Wrapper around htmlspecialchars()
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @see    htmlspecialchars()
+ */
+function hsc($string){
+  return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
+}
+
+/**
+ * print a newline terminated string
+ *
+ * You can give an indention as optional parameter
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function ptln($string,$intend=0){
+  for($i=0; $i<$intend; $i++) print ' ';
+  print"$string\n";
+}
+
 /**
  * Return info about the current document as associative
  * array.
diff --git a/inc/template.php b/inc/template.php
index 488ce211b0af1e69bf769d8accc59d03ff3212e0..bda0a7e4bfc3df6256b2e0a64241f20f0252411a 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -9,28 +9,6 @@
   if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/');
   require_once(DOKU_CONF.'dokuwiki.php');
 
-/**
- * Wrapper around htmlspecialchars()
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- * @see    htmlspecialchars()
- */
-function hsc($string){
-  return htmlspecialchars($string);
-}
-
-/**
- * print a newline terminated string
- *
- * You can give an indention as optional parameter
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function ptln($string,$intend=0){
-  for($i=0; $i<$intend; $i++) print ' ';
-  print"$string\n";
-}
-
 /**
  * Returns the path to the given template, uses
  * default one if the custom version doesn't exist