Skip to content

encode sheetnames and cells maybe more good #26

@yujianyue

Description

@yujianyue

public function encode($txt){
$arr=array('EUC-CN' => 'GB2312','CP936' => 'GBK','SJIS-mac'=>'MacJapanese','SJIS-Mobile#DOCOMO'=>'SJIS-DOCOMO','SJIS-Mobile#KDDI'=>'SJIS-KDDI','SJIS-Mobile#SOFTBANK'=>'SJIS-SOFTBANK','UTF-8-Mobile#DOCOMO'=>'UTF-8-DOCOMO','UTF-8-Mobile#KDDI-B'=>'UTF-8-KDDI','UTF-8-Mobile#SOFTBANK'=>'UTF-8-SOFTBANK','ISO-2022-JP-MOBILE#KDDI'=>'ISO-2022-JP-KDDI');
$encode = mb_detect_encoding($txt, ['ASCII', 'UTF-8', 'GB2312', 'GBK', 'BIG5']);
if(array_key_exists($encode, $arr)) $encode = $arr[$encode];
return mb_convert_encoding($txt, 'UTF-8', $encode);
}
//sheetnames and cells
//sheetnames: 'name' => $rec_name,
//cells: $s['cells'][$i][$j ];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions