Re: Replacing special characters with their HTML equivalents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



James Colannino wrote:

> Hey everyone.  I have a question.  I have a web scraper that grabs
> information from web pages that often contain characters such as
> vowels with umlots (I know I spelled that wrong.)
> 
> The data is editable, so the characters show up unmodified in an
> editable text box.  However, when I try to import the data into a
> MySQL database, the first occurrence of such a character, along with
> the rest of the string, is truncated from the result. 

Your mysql table will have a characterset attribute - if what you're
inserting doesn't match, it will complain.  If converting with
htmlentities() works for your purpose, that's one solution, otherwise
I'd make the mysql table use UTF8 and then look into iconv to convert
all scraped pages to UTF8.


/Per Jessen, Zürich


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux