This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Summary
MethodsPropertiesConstantsNumberToName() No public properties foundNo constants foundNo protected methods foundNo protected properties foundN/ANo private methods foundNo private properties foundN/A
Methods
NumberToName()
NumberToName(integer $codePage = 1252) : string
Convert Microsoft Code Page Identifier to Code Page Name which iconv
and mbstring understands
Parameters
integer
$codePage
Microsoft Code Page Indentifier
Throws
\PHPExcel_Exception
Returns
string
—
Code Page Name
CodePage.php
<?php/**
* PHPExcel_Shared_CodePage
*
* Copyright (c) 2006 - 2015 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Shared
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/classPHPExcel_Shared_CodePage{/**
* Convert Microsoft Code Page Identifier to Code Page Name which iconv
* and mbstring understands
*
* @param integer $codePage Microsoft Code Page Indentifier
* @return string Code Page Name
* @throws PHPExcel_Exception
*/publicstaticfunctionNumberToName($codePage=1252){switch($codePage){case367:return'ASCII'; // ASCII
case437:return'CP437'; // OEM US
case720:thrownewPHPExcel_Exception('Code page 720 not supported.'); // OEM Arabic
case737:return'CP737'; // OEM Greek
case775:return'CP775'; // OEM Baltic
case850:return'CP850'; // OEM Latin I
case852:return'CP852'; // OEM Latin II (Central European)
case855:return'CP855'; // OEM Cyrillic
case857:return'CP857'; // OEM Turkish
case858:return'CP858'; // OEM Multilingual Latin I with Euro
case860:return'CP860'; // OEM Portugese
case861:return'CP861'; // OEM Icelandic
case862:return'CP862'; // OEM Hebrew
case863:return'CP863'; // OEM Canadian (French)
case864:return'CP864'; // OEM Arabic
case865:return'CP865'; // OEM Nordic
case866:return'CP866'; // OEM Cyrillic (Russian)
case869:return'CP869'; // OEM Greek (Modern)
case874:return'CP874'; // ANSI Thai
case932:return'CP932'; // ANSI Japanese Shift-JIS
case936:return'CP936'; // ANSI Chinese Simplified GBK
case949:return'CP949'; // ANSI Korean (Wansung)
case950:return'CP950'; // ANSI Chinese Traditional BIG5
case1200:return'UTF-16LE'; // UTF-16 (BIFF8)
case1250:return'CP1250'; // ANSI Latin II (Central European)
case1251:return'CP1251'; // ANSI Cyrillic
case0: // CodePage is not always correctly set when the xls file was saved by Apple's Numbers program
case1252:return'CP1252'; // ANSI Latin I (BIFF4-BIFF7)
case1253:return'CP1253'; // ANSI Greek
case1254:return'CP1254'; // ANSI Turkish
case1255:return'CP1255'; // ANSI Hebrew
case1256:return'CP1256'; // ANSI Arabic
case1257:return'CP1257'; // ANSI Baltic
case1258:return'CP1258'; // ANSI Vietnamese
case1361:return'CP1361'; // ANSI Korean (Johab)
case10000:return'MAC'; // Apple Roman
case10001:return'CP932'; // Macintosh Japanese
case10002:return'CP950'; // Macintosh Chinese Traditional
case10003:return'CP1361'; // Macintosh Korean
case10004:return'MACARABIC'; // Apple Arabic
case10005:return'MACHEBREW'; // Apple Hebrew
case10006:return'MACGREEK'; // Macintosh Greek
case10007:return'MACCYRILLIC'; // Macintosh Cyrillic
case10008:return'CP936'; // Macintosh - Simplified Chinese (GB 2312)
case10010:return'MACROMANIA'; // Macintosh Romania
case10017:return'MACUKRAINE'; // Macintosh Ukraine
case10021:return'MACTHAI'; // Macintosh Thai
case10029:return'MACCENTRALEUROPE'; // Macintosh Central Europe
case10079:return'MACICELAND'; // Macintosh Icelandic
case10081:return'MACTURKISH'; // Macintosh Turkish
case10082:return'MACCROATIAN'; // Macintosh Croatian
case21010:return'UTF-16LE'; // UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE
case32768:return'MAC'; // Apple Roman
case32769:thrownewPHPExcel_Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3)
case65000:return'UTF-7'; // Unicode (UTF-7)
case65001:return'UTF-8'; // Unicode (UTF-8)
}thrownewPHPExcel_Exception('Unknown codepage: '.$codePage);}}