changeset 509:c63c7f98147a

Add UTF-8 kludge.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 08 Dec 2013 00:01:58 +0200
parents b6fe46c86ff3
children 25bc2087869e
files results.inc.php
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/results.inc.php	Sat Dec 07 19:38:42 2013 +0200
+++ b/results.inc.php	Sun Dec 08 00:01:58 2013 +0200
@@ -10,6 +10,15 @@
 $voteKeyMode = stGetSetting("voteKeyMode");
 
 
+function stKludge($str)
+{
+  $tmp = $str;
+  foreach (array("ä" => "a", "ö" => "o", "Ä" => "A", "Ö" => "O") as $sfrom => $sto)
+    $tmp = str_replace($sfrom, $sto, $tmp);
+
+  return $tmp;
+}
+
 function stGetNumberSuffix($val)
 {
   switch ($val)
@@ -122,8 +131,8 @@
             echo "  -''-";
 
           printf("  %s  by  %s (%d pts)\n",
-            chentities(stStrChop($entry["name"], 30)),
-            chentities(stStrChop($showAuthors ? $entry["author"] : "-", 30)),
+            chentities(stStrChop(stKludge($entry["name"]), 30)),
+            chentities(stStrChop($showAuthors ? stKludge($entry["author"]) : "-", 30)),
             $entry["votesum"]);
 
           $prev = $entry["votesum"];