]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge remote-tracking branch 'ArthurHoaro/localecharset' into next
authornodiscc <nodiscc@gmail.com>
Fri, 10 Apr 2015 18:30:15 +0000 (20:30 +0200)
committernodiscc <nodiscc@gmail.com>
Fri, 10 Apr 2015 18:30:15 +0000 (20:30 +0200)
1  2 
index.php

diff --combined index.php
index b622f9631a605f01d3cb23afd9aaeefabe68357f,174f52034a62c9b839f38c632f9fd8166f8ed837..69a53c56a70593f7954b8ca64aae730adde6a282
+++ b/index.php
@@@ -307,9 -307,10 +307,10 @@@ function autoLocale(
      {   // (It's a bit crude, but it works very well. Preferred language is always presented first.)
          if (preg_match('/([a-z]{2})-?([a-z]{2})?/i',$_SERVER['HTTP_ACCEPT_LANGUAGE'],$matches)) {
              $loc = $matches[1] . (!empty($matches[2]) ? '_' . strtoupper($matches[2]) : '');
-             $attempts = array($loc, str_replace('_', '-', $loc),
-                 $loc . '_' . strtoupper($loc), $loc . '_' . $loc,
-                 $loc . '-' . strtoupper($loc), $loc . '-' . $loc);
+             $attempts = array($loc.'.UTF-8', $loc, str_replace('_', '-', $loc).'.UTF-8', str_replace('_', '-', $loc),
+                 $loc . '_' . strtoupper($loc).'.UTF-8', $loc . '_' . strtoupper($loc), 
+                 $loc . '_' . $loc.'.UTF-8', $loc . '_' . $loc, $loc . '-' . strtoupper($loc).'.UTF-8', 
+                 $loc . '-' . strtoupper($loc), $loc . '-' . $loc.'.UTF-8', $loc . '-' . $loc);
          }
      }
      setlocale(LC_TIME, $attempts);  // LC_TIME = Set local for date/time format only.
@@@ -1775,6 -1776,7 +1776,6 @@@ HTML
  
      // -------- Otherwise, simply display search form and links:
      $PAGE = new pageBuilder;
 -    $PAGE->assign('linkcount',count($LINKSDB));
      buildLinkList($PAGE,$LINKSDB); // Compute list of links to display
      $PAGE->renderPage('linklist');
      exit;