Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP, MySQL & HTML with French Accents

How do I handle french accents?

5:55 pm on Sep 11, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 14, 2002
votes: 0

I realize this topic has been discussed but I was unable to find one that covered all my concerns and end the confusion. Here's my situation.

I have an expression that checks the validity of an e-mail address and an expression that creates a user name based on first/last name.

How do I add support to these expressions for French accents that PHP, MySQL and HTML can handle? Do I use HTML entities, unicode, URL encoding, etc.?

Here's the two expressions that are currently removing french accents.

User Name Creation
$prefix = substr($szFirstName, 0, 1);
$szLoginName = $prefix . $szLastName;
$szLoginName = strtolower($szLoginName);
$szFirstName = eregi_replace("[^a-z-]", "", $szFirstName);
$szLastName = eregi_replace("[^a-z-]", "", $szLastName)

E-mail Validity Check
ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{}~] +\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{}~]+$', $szEmail)

[edited by: jatar_k at 8:47 pm (utc) on Sep. 11, 2002]
[edit reason] added space in ereg to stop sidescroll [/edit]

8:48 pm on Sept 11, 2002 (gmt 0)


WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
votes: 0

take a look at this thread



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members