That did it! It seems that my version of MySQL doesn't support Unicode
encoding, only the various ISO encodings. So, I guess this translation is
necessary before storing all text in the DB so foreign characters aren't
broken when I retrieve them from the DB.

Thanks! 


I2eptilex wrote:
> 
> Well it seems you have a UTF-8 encoded text after your function. Use
> iconv to change it. See http://de3.php.net/manual/en/ref.iconv.php .
> 
> try doing this with your array before inserting it into the DB
> 
> foreach($insert_array as $key => $var){
> $new_arr[$key] = iconv("UTF-8", "ISO-8859-1", $var);
> }
> 
> It can be that your array has a different coding than UTF-8 check the
> manual for the htmlentities function, but i'm pretty shure that should
> solve it.
> 
> I2eptilex
> 
> Monty wrote:
> 
>> I'm having a problem figuring out how to deal with foreign characters in
>> text that was copied from an MS Word document and pasted into a form field.
>> 
>> I'm not how sure this is getting stored in the MySQL database, but, when I
>> run htmlentities() on this text, each foreign character is converted into 2
>> other foreign characters that don't at all represent the original.
>> 
>> For example, a lowercase u with an umlat over it (ü) is somehow displayed as
>> an uppercase A with an umlat over it followed by the 1/4 symbol after parsed
>> by htmlentities(). A lowercase o with an ulmat displays as an uppercase A
>> with an umlat over it followed by the paragraph symbol. It seems that the
>> uppercase A w/umlat is a constant, and the next character changes.
>> 
>> The ord() function returns the same number for all of these foreign
>> characters: 195. So, I'm not sure what's happening with these foreign
>> characters, and if there's any way to convert them to proper htmlentities
>> before being displayed in a browser. I thought htmlentities would do this,
>> actually.
>> 
>> Thanks!
>> 
>> Monty.

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

Reply via email to