1
4

2 回答 2

1

Given that you're getting 9 characters in the output for 3 characters in the input, it's most likely that Windows is defaulting to thinking that your spreadsheet is encoded using Cpc-1252.

I haven't used the libraries in question, but Googling suggests that this might be the answer.

Going by your code, I think that once you create the $worksheet variable, you want to try the following:

$worksheet2->setInputEncoding('utf-8');

That's assuming that your database storage and connection are set to UTF-8. Basically, set the worksheet encoding to be the same as what you're storing your data as.

于 2012-10-06T10:26:16.157 回答
0

try with this code:

$text = htmlentities ( "大股东" , ENT_COMPAT ,  'UTF-8', true);
于 2012-10-06T07:22:43.273 回答