Jump to content

The � symbol


lostprophetpunk

Recommended Posts

This doesn't always work.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 

I usually force with a header at the top of every script (or common include):

header('Content-Type: text/html; charset=UTF-8');

If you have funny characters in your database you could use mbstring extensions to convert the encoding:

$string = "abc";
print mb_convert_encoding($string, "UTF-8", "auto");

Prior to inserting records in your database run the following query. Best straight after a connection has been established.

mysql_query("SET NAMES UTF8");

Do not attempt to convert characters.

Link to comment
Share on other sites

which I copied the text from a text document I had created in word 07

What does the character look like in your database? Microsoft uses non standard encodings. Do you have some sort of javascript HTML editor that you are using to insert your blog content? If so it will be retaining the MS Word formatting. You should paste the text from Word into a text editor first (i.e. notepad) and then copy into your textarea for insert to your blog. Not directly from MS word!

If you are using a javascript editor to insert your blogs such as http://www.fckeditor.net/ there should be a config setting to force pasted content as plain text and not retain formatting (at least this one does). You will never be able to replace characters that have come from MS Word, trust me I have tried.

Link to comment
Share on other sites

which I copied the text from a text document I had created in word 07

What does the character look like in your database? Microsoft uses non standard encodings. Do you have some sort of javascript HTML editor that you are using to insert your blog content? If so it will be retaining the MS Word formatting. You should paste the text from Word into a text editor first (i.e. notepad) and then copy into your textarea for insert to your blog. Not directly from MS word!

If you are using a javascript editor to insert your blogs such as http://www.fckeditor.net/ there should be a config setting to force pasted content as plain text and not retain formatting (at least this one does). You will never be able to replace characters that have come from MS Word, trust me I have tried.

I am not using javascript at all in my blog system. I have made it so that it mysql_real_escape_string(htmlentities()); the content befor entering the database.

Link to comment
Share on other sites

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.