Categories > OpenTBS with DOCX >

how to use chinese word in docx

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: wkl
Date: 2014-08-20
Time: 06:31

how to use chinese word in docx

Dear all,

when i input chinese word(big5) in $data[]= array('data'=>'測試'); in demo_ms_word.php,


characters can not show the right words in docx file .

How can i fix it? thanks.

Dennis
By: Skrol29
Date: 2014-08-20
Time: 14:17

Re: how to use chinese word in docx

Hi,

The DOCX only knows UTF-8 characters, not BIG5.
By: estas
Date: 2014-09-05
Time: 14:15

Re: how to use chinese word in docx

That is strange, we use docx format for all our languages including Chinese, Russian etc... We want to switch our template engine to TBS but we need this functionality! We want to use TBS to generate information sheets of our products. We want to be able to do this in 10 languages including Chinese and Russian. Is this possible?
By: Sheepy
Date: 2014-09-08
Time: 08:28

Re: how to use chinese word in docx

Yes. Unicode supports multiple languages, including Chinese and Russian. Docx use UTF-8 which is unicode.

Languages / encoding support is provided / decided by platform; By design TinyButStrong does not provide or deny languages / encoding support.

If your programmers are not well versed in unicode/encoding, I'd advise first spending some time to learn why you cannot mix Big5 Chinese with GBK Chinere or CP866 Russian, and why you can mix UTF-8 Chinse with UTF-8 Russian which is what you will need to do.
By: estas
Date: 2014-09-08
Time: 13:32

Re: how to use chinese word in docx

Thank you Sheepy. It's a rather strange reply but never the least, it's a reply. We will look into this. (or use a complete different script and not TBS)
By: JimH
Date: 2014-09-08
Time: 16:45

Re: how to use chinese word in docx

Does this forum also provide solutions? (for non programmers) I found this problem on several topics but never with a solution. I'm trying to make the demo_ms_word.php work with Unicode characters but  can not seem to get it done. It would be great if someone would provide a working demo so generating a docx (or other open document) with Unicode characters is possible. The demo provided with OpenTBS simply does not work with UTF-8 characters.
By: estas
Date: 2014-09-08
Time: 17:10

Re: how to use chinese word in docx

Solution: in demo_ms_word.php search for $TBS->LoadTemplate($template); and change it in $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
By: JimH
Date: 2014-09-09
Time: 07:50

Re: how to use chinese word in docx

Solved indeed. Could not believe it was that simple. Works fine now. Thnx estas 
By: Skrol29
Date: 2014-09-09
Time: 23:12

Re: how to use chinese word in docx

Thanks for those comments

I will add the option OPENTBS_ALREADY_UTF8 in the examples in order to make that clearer, even if it has no effect in the given examples.