Jump to content

Displaying the € symbol


cparekh

Recommended Posts

Hi,

 

I'm pulling data from a DB and some of this contains the € symbol which displays as a '?' - what can I use to display this symbol properly?

 

I've tried htmlspecialchars() and htmlentities() but no go!

 

Possibly on a related note, some of the info in the db contains MS characters like 'smart tags' for single and double quotes. These also display as '?' marks. Is there a way to have php display these properly?

 

Thanx in advance.

 

C.

Link to comment
Share on other sites

Hi,

 

unfortunately the db is in use for a CRM (GoldMine, which uses a MSSQL db) and so a lot of the data is input directly into the db from the GM interface. The data it holds goes back a few years so the only alternative would be to manually replace special characters.

 

Incidentally, I manually replaced the € symbol in the db in case it had been a cut & paste job from Word or similar but it still displays as a '?' in the output.

 

May be helpful to mention that I use xmlodbc to access and pull the data out from GM - are there any functions for xml I could use to convert these characters on the way out?

Link to comment
Share on other sites

Hi effigy,

 

tried changing the character set meta tag to charset=iso-8859-1 as well as charset=iso-8859-15, the former being Western European and the latter Western European including support for the € symbol but that didn't work either.

 

I used the same in htmlentities() but none of it seems to make a difference. The $ and £ symbols appear a-ok just not the €.

 

Could the problem lie in the xml from using xmlodbc?

 

I also haven't been able to get the MS 'smart-quotes' to appear properly. Any ideas? conker87 mentioned he uses some code to get rid of them altogether...

Link to comment
Share on other sites

And what encoding was used when this data was inserted into the database? Without knowing this, I'm not sure how the Euro worked its way in there. You can determine how it's being identified with a combination of MySQL's SUBSTRING and HEX.

 

Smart quotes do not exist in 8859-1. You'll have to replace them with normal quotes.

Link to comment
Share on other sites

Hi all,

 

firstly, much appreciation for all your help.

 

Due to a time crunch I've had to take an 'easy' way to sort this out for the moment; Thankfully the € symbol only appeared in a few spots and I've done the necessary currency conversions and we're now using £! As for the 'smart-quotes' these also only appear in small amounts of very specific text - I've done a simple string replace for the '?' marks into single quotes. Not ideal for the long term but it'll do for now :)

 

A good post to read more about 'smart-quotes' is here http://www.phpfreaks.com/forums/index.php/topic,167355.0.html 

 

Thanks again,

C.

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.