Jump to content

Archived

This topic is now archived and is closed to further replies.

Heero

*SOLVED* phpincludes problem

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--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!

Share this post


Link to post
Share on other sites

×

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.