Phpexcel cannot output Chinese

Source: Internet
Author: User

Problem Description: When using Phpexcel, if the Chinese content is filled in the cell, it will cause the output cell to be empty, even Chinese characters (?!). etc.) are not recognized.

Cause: From the Internet to check is the problem of Utf-8

WORKAROUND: You can use the ICONV function to implement the encoding conversion

This can be accomplished using PHP's own encoding conversion function iconv

$objPHPExcel->setactivesheetindex (0)

->setcellvalue (' A1 ', iconv (' GBK ', ' utf-8 ', ' Chinese Hello '))
->setcellvalue (' B2 ', ' world! ')
->setcellvalue (' C1 ', ' Hello ')
->setcellvalue (' D2 ', ' world! ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.