I have a webpage that is set to UTF-8. But parts of its content (built in php) come from iso-8859-1 files and are thus not displayed correctly.
Is it possible to set a specific encoding for a particular page element?
I have a webpage that is set to UTF-8. But parts of its content (built in php) come from iso-8859-1 files and are thus not displayed correctly.
Is it possible to set a specific encoding for a particular page element?
No, I don't think this can be done. Since you already use UTF-8 inside the page, there must be something wrong while reading the content from other pages if you get unexpected results. You shouldn't experience any problems with a UTF-8 page.
No, only a single encoding can be used on one page. You might want to encode your iso-stuff to entities that's generated by PHP.
You may end up using an iframe to display the other content so you can set your meta tag for the character encoding you need.
How are you inserting the Latin-1 files into the page? If you're loading them as text and then including them as text, then I'd hope the relevant conversion would be performed for you. If you're just including the files without any transformation, that would indeed be an issue.
I don't know what PHP uses as its internal text format (e.g. Unicode) but if you can use that as an intermediate encoding, it should be okay.
You could, instead of including that output directly, pass that php output through a conversion script.
PhP has a decent conversion function mb_convert_encoding that could make the task easier.