Jump to content

different character sets for widget


zuzacat

Recommended Posts

Hello everyone,

 

I have created a widget with php which allows users to put on their webpage and displays some information. To display the widget I am creating a javascript code for users to put on their websites.

The javascript has a source of php page like src="widget.php?id=123" When they put the code on their websites php file is executed and displays some texts which is read from a remote XML file. There is no problem up to this point. But while I am reading from this XML file, the texts which are displayed on users webpage, are not in good format becouse I am converting string texts to ISO_8859-9 charset with "iconc" function.

 

If the charset of webpage is ISO-8859-9 text are displayed correctly but if it is not, text are not displayed as expected.

 

In example if the webpage charset is set to UTF-8, characters become unreadable. If I know the charset of webpage I can then convert strings to that charset. But could not find a predifined function thats doing this.

 

Any idea about this problem ? or any other solutions you advice for this problem ?

 

Thank you...

Link to comment
https://forums.phpfreaks.com/topic/215058-different-character-sets-for-widget/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.