Codeigniter/PHPexcel 在 xls 文件的属性中设置阿拉伯语标题 [英] Codeigniter / PHPexcel Set arabic title in properties of xls file
问题描述
我正在使用 Codeigniter 处理我的网络项目.我想通过设置文件中的数据生成一个excel文件,现在很酷.
I am working on my web project using Codeigniter. I want to generate an excel file by setting the data in the file, for now that's cool.
但我有一个问题是该网站使用阿拉伯语作为主要语言,我会在excel文件的属性中设置标题和描述.
but I have a problem is that the site uses Arabic as a primary language, and I would set the title and description in the properties of excel file.
当我打开excel文件并打开属性时,它不显示阿拉伯语的标题和描述,而是这样:
when I open the excel file and I open the properties, it does not display the title and description in Arabic, but like this:
هل تعتقدãï£Ù† النظاÙ... السوري سيستجيبلá´Ø±ÙˆØ·Ø®Ø§ã˜Â·Ã™ÂينسÃ∼§Ø¡ وأÃ∼·ÙÂÃ∼§Ù„ من Ã∼§Ù„Ã∼¹Ù„وين؟
هل تعتقد أن النظام السوري سيستجيب لشروط خاطÙÂي نساء وأطÙÂال من العلوين؟
我试过 utf8_decode 函数,但它不起作用
I tried utf8_decode function but it does not work
谢谢
推荐答案
问题是excel文件保存的是版本5,那我应该用2007版本(.xlsx)注册,阿拉伯值在文件属性:
the problem is that the excel file is saved version 5, then I should Register with the 2007 version (. xlsx) and the Arabic values appear correctly in file properities:
$obj_writer = PHPExcel_IOFactory::createWriter($this->excel, 'Excel2007');
$obj_writer->save('php://output');
这篇关于Codeigniter/PHPexcel 在 xls 文件的属性中设置阿拉伯语标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!