OSDN Git Service

Shift_JIS support for mobile phone.
authorkmorimatsu <kmorimatsu@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Tue, 16 Dec 2008 01:12:56 +0000 (01:12 +0000)
committerkmorimatsu <kmorimatsu@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Tue, 16 Dec 2008 01:12:56 +0000 (01:12 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@728 1ca29b6e-896d-4ea0-84a5-967f57386b96

utf8/nucleus/libs/globalfunctions.php

index 1f0e89f..bba7806 100755 (executable)
@@ -1542,6 +1542,12 @@ function encoding_check($val, $key, $encoding=false, $exclude=false) {
                                $search='/^([\x00-\x7F]+'.\r
                                        '|[\xA1-\xF7][\xA1-\xFE])*/';\r
                                break;\r
                                $search='/^([\x00-\x7F]+'.\r
                                        '|[\xA1-\xF7][\xA1-\xFE])*/';\r
                                break;\r
+                       case 'shift_jis':\r
+                               // Note that shift_jis is only supported for output.\r
+                               // Using shift_jis in DB is prohibited.\r
+                               $search='/^([\x00-\x7F\xA1-\xDF]+'.\r
+                                       '|[\x81-\x9F\xE0-\xFC][\x40-\xFC])*/';\r
+                               break;\r
                        default:\r
                                $search=false;\r
                                if (preg_match('/^iso\-8859\-[0-9]{1,2}$/',$encoding)) break;\r
                        default:\r
                                $search=false;\r
                                if (preg_match('/^iso\-8859\-[0-9]{1,2}$/',$encoding)) break;\r