1

I'm using

iconv('UTF-8', 'ASCII//TRANSLIT', $string)

To convert all single quotes to the default one, but at the same time all pound symbols £ are converted to question marks ? - any idea how this can be avoided while everything else gets converted?

Sebastian Sulinski
  • 5,815
  • 7
  • 39
  • 61
  • The pound symbol isn't in the ASCII character set. Why would you expect it to not be transliterated? Convert to a character set that has the symbol you want in it. Refer to http://stackoverflow.com/questions/11843407/php-convert-utf-8-to-ascii-8-bit – Oesor Feb 10 '15 at 22:37
  • The problem is that I don't want characters such as 'acute' or any other non-standard single quotes etc. which sometimes get copied from word document or any other text editor. and ASCII does it very well - extended version adds 'acute' to the list. Not sure if there's any other, similar characterset to ASCII which does that exactly - otherwise I will probably have to convert pound symbol to some combination of characters and then convert it back after it's been run through the iconv. – Sebastian Sulinski Feb 10 '15 at 22:41
  • One person's "non-standard" is another person's letter of the alphabet. I suggest posting a new question with the problem you're really trying to solve. – David Moles Feb 10 '15 at 23:13
  • I'm really trying to replace all smart quotes with simple ASCII ones - that's all. I would prefer to have it all as UTF-8, but without the smart quotes - any idea? – Sebastian Sulinski Feb 11 '15 at 08:11
  • It seems I've found the answer here http://stackoverflow.com/questions/20025030/convert-all-types-of-smart-quotes-with-php – Sebastian Sulinski Feb 11 '15 at 08:48

0 Answers0