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
https://forums.phpfreaks.com/topic/93362-character-encoding-problem/
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.

Archived

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

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