Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/129296-more-than-one-charset/
Share on other sites

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.

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?

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)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.