htmlentities and foreign characters from MS Word

From: Date: Sun, 05 Sep 2004 06:00:33 +0000
Subject: htmlentities and foreign characters from MS Word
Groups: php.general 
Request: Send a blank email to php-general+get-195897@lists.php.net to get a copy of this message
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.

« previous php.general (#195897) next »