more than one charset?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nicosns
Forum Newbie
Posts: 21
Joined: Thu Jun 21, 2007 1:53 pm

more than one charset?

Post by nicosns »

Hello,

Can I use more than one charset in the same page?

I have a html page in German language. In htaccess I use this html file as php and use the function 'include'. Now the html file works well with charset=ISO-8859-1, but the included file doesn 't. Last one works well with charset=utf-8. Can I use those 2 in the same page?? thx
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: more than one charset?

Post by requinix »

No, pick one and run with it.

If you're mixing charsets, pick a generic one like UTF-8 and encode everything into that format. Or you can encode the bad file into ISO 8859-1 which will leave the data intact yet understandable by the browser.
nicosns
Forum Newbie
Posts: 21
Joined: Thu Jun 21, 2007 1:53 pm

Re: more than one charset?

Post by nicosns »

Thanks. I have found you can save a file in a different format within a text editor. This helps, but it's not perfect. Another solution that I found is that you can use ascii to replace the strange characters in one file, leaving the other (the file you include) like it is.

Maybe there is a simpler solution, so all post if you think it works. thx
Post Reply