homepage Welcome to WebmasterWorld Guest from 54.197.147.90
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP, MySQL & HTML with French Accents
How do I handle french accents?
The_Warden




msg:1257201
 5:55 pm on Sep 11, 2002 (gmt 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]

 

jatar_k




msg:1257202
 8:48 pm on Sep 11, 2002 (gmt 0)

take a look at this thread

[webmasterworld.com...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved