Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am exporting unicode data using Php COM. I have written in top of my web page the below line:

<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
But when I export the unicode data into a word document using Php COM, It is not coming properly like a unicode, Instood it is coming as shown below:

ಆದಿಯಲà³à²²à²¿ ದೇವರೠಆಕಾಶವನà³à²¨à³

What I have tried:

<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
$unicode_data = "ಆದಿಯಲ್ಲಿ";
$word = new variant(com_get_active_object("word.application"));
$word->Selection->TypeText($unicode_data);
?>
Posted
Updated 11-Aug-16 22:53pm
v4

1 solution

That is because Word is using the default font and character set to display the characters. You need to add information to tell it which font and language to use.
 
Share this answer
 
Comments
Nathan Henry 16-Aug-16 6:07am    
Yes Exactly. Please tell me how to do this using php com ?
Richard MacCutchan 16-Aug-16 6:38am    
Sorry, I don't know PHP. However, I would assume that you need to set some values in your $word variable's properties.
Nathan Henry 16-Aug-16 7:27am    
Yes for custom font i use this:
$word->Selection->Font->Name = 'fontname';
But I dont know what property to use for the unicode...
Richard MacCutchan 16-Aug-16 7:29am    
The only way to find out is to look at the documentation for that class.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900