nicob Posted October 20, 2008 Share Posted October 20, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/129296-more-than-one-charset/ Share on other sites More sharing options...
sKunKbad Posted October 20, 2008 Share Posted October 20, 2008 No, you can't have more than one charset per page served. I might be wrong, but I think you are going to have to have your user select which language he/she prefers, save it in a cookie, and then serve up all of the pages with that charset. Quote Link to comment https://forums.phpfreaks.com/topic/129296-more-than-one-charset/#findComment-670313 Share on other sites More sharing options...
nicob Posted October 20, 2008 Author Share Posted October 20, 2008 Thanks sKunKbad. I hoped that there was a simple solution. I work with Google visitors, and letting them choose their language is an obstacle. Maybe using ascii code for the html page, to convert all strange characters? Maybe someone else have found a solution for this problem? Quote Link to comment https://forums.phpfreaks.com/topic/129296-more-than-one-charset/#findComment-670320 Share on other sites More sharing options...
surion Posted October 20, 2008 Share Posted October 20, 2008 hmmm, I had problems like this before as well. now I work with UTF-8 all the time, everything is UTF-8 encoded here. takes some operations tough, server encoding, mysql encoding, and file encoding should all be UTF-8 to become that. for everything I code with notepad++ I perform menu "format" => "encode as UTF-8", and I have a text2db and a db2text function to format user input values performing some needed replaces (html entities and stuf) dunno if this is the correct way to work, but it works for me. Most projects I make are 4-languaged (Dutch, French, German, English). It takes quiet some effort the way I do it. If anyone has a better option how to get everything in one single charset I d realy like to hear it i can imagine not everyone has access to the server encoding for example,... (i work on virtual dedicated, so i have) Quote Link to comment https://forums.phpfreaks.com/topic/129296-more-than-one-charset/#findComment-670332 Share on other sites More sharing options...
nicob Posted October 20, 2008 Author Share Posted October 20, 2008 Thanks Surion! Saving the file in the right format within the text editor does the trick for me. It's not perfect, but now I understand the how. Quote Link to comment https://forums.phpfreaks.com/topic/129296-more-than-one-charset/#findComment-670345 Share on other sites More sharing options...
surion Posted October 21, 2008 Share Posted October 21, 2008 no problem anywayz, still wondering if somebody has a better suggestion for the problem than the solution I use? cause tough it works well, its quiet some work, and also quiet some shit if you forgot a file, and have to search wich one it was Quote Link to comment https://forums.phpfreaks.com/topic/129296-more-than-one-charset/#findComment-670698 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.