Jump to content

character encoding problem


chick3n

Recommended Posts

sample text: ☼☼☼ ▬ ▬☼☼☼

my result: ☼☼☼ ▬ %

what i want: ☼☼☼ ▬ ▬☼☼☼

 

I parse a website and it has these extended ascii characters like above.

I read in the page from CURL and get that string above.

php turns it into "☼☼☼ ▬ %" and than it gets inputed into the mySQL database as that.

 

How can i maintain the original characters?

 

Ive tried utf8_encode, rawurlencode, combinations of the 2.

Link to comment
Share on other sites

There are a number of steps you have to check to make sure this will work. Mainly, you have to have consistent character settings all the way through.

 

If you are drawing text from a database,  then you have to set the database character set.

 

You have to make sure the internal encoding for PHP is the same characterset

 

You have to save your documents in that same characterset

 

You have to set a meta tag at the top of your document that has that same characterset.

 

Check all these charactersets and see if they are the same.

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.