Heero Posted May 10, 2006 Share Posted May 10, 2006 Hey guys,I already know how the PHPincludes function works. I am currently designing a website that uses chinese text, as a result I have to remember to use the charset of UTF-8 and this must be included in every page or else the text appear as "???"So the problem is my phpincludes are just blocks of html code and they are not necessary from the header tag. In other words, I can't include the charset of UTF-8 in every phpinclude file.For example say,index.php file includes a test.php file.The index.php has the:<?php header('Content-Type: text/html; charset=utf-8'); ?><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">stuff, while the test.php has all the chinese text but none of the charset stuff. When I try to save test.php all the text will revert to ??? and so when I include it in the index.php it appears as ???Can anyone help me? Quote Link to comment https://forums.phpfreaks.com/topic/9442-solved-phpincludes-problem/ Share on other sites More sharing options...
hvle Posted May 10, 2006 Share Posted May 10, 2006 This is easy, just use a text editor with multibytes encoded.you can use the same editor that you write chinese code. Simply write php codes in it and save as php file. I used M.S. Visual studio .NET, but there're million of editor out there you can find. Quote Link to comment https://forums.phpfreaks.com/topic/9442-solved-phpincludes-problem/#findComment-34825 Share on other sites More sharing options...
Heero Posted May 10, 2006 Author Share Posted May 10, 2006 [!--quoteo(post=372828:date=May 9 2006, 09:17 PM:name=hvle)--][div class=\'quotetop\']QUOTE(hvle @ May 9 2006, 09:17 PM) [snapback]372828[/snapback][/div][div class=\'quotemain\'][!--quotec--]This is easy, just use a text editor with multibytes encoded.you can use the same editor that you write chinese code. Simply write php codes in it and save as php file. I used M.S. Visual studio .NET, but there're million of editor out there you can find.[/quote]I don't really understand your solution. I use dreamweaver as my developing environment. When I save it simply says this:"The document's current encoding can not correctly save all of the characters within the document. You may want to change to UTF-8 or an encoding that supports the special characters in this document."I have to add the meta and php charset tag to prevent this from occuring. Quote Link to comment https://forums.phpfreaks.com/topic/9442-solved-phpincludes-problem/#findComment-34835 Share on other sites More sharing options...
wildteen88 Posted May 10, 2006 Share Posted May 10, 2006 You might want to configure Dreamweaver to use the UTF-8 charset by defualt.You can do this by opening Dreamweaver then if you go to [b]Edit[/b] > [b]Preferences[/b] > and now the preferences window appears select the option from the list that says [b]New Document[/b] Now from the [b]Defualt encoding[/b] pull down menu select [b]UTF-8[/b] charset. Quote Link to comment https://forums.phpfreaks.com/topic/9442-solved-phpincludes-problem/#findComment-34879 Share on other sites More sharing options...
Heero Posted May 11, 2006 Author Share Posted May 11, 2006 [!--quoteo(post=372882:date=May 10 2006, 03:04 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ May 10 2006, 03:04 AM) [snapback]372882[/snapback][/div][div class=\'quotemain\'][!--quotec--]You might want to configure Dreamweaver to use the UTF-8 charset by defualt.You can do this by opening Dreamweaver then if you go to [b]Edit[/b] > [b]Preferences[/b] > and now the preferences window appears select the option from the list that says [b]New Document[/b] Now from the [b]Defualt encoding[/b] pull down menu select [b]UTF-8[/b] charset.[/quote]That solved the problem. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/9442-solved-phpincludes-problem/#findComment-35129 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.