lafafmentvotre Posted July 17, 2009 Posted July 17, 2009 Hi everybody First sorry for my bad english. I want to know how can i prevent accents in a inputbox but not for all. In my first inputbox > Prevent accents In my second inputbox > Authorize accents and how to convert accents with no accents when user write in imputbox (like stringreplace($my_inputbox, "é", "e") I hope i'm clear Thanks for help
Mat Posted July 17, 2009 Posted July 17, 2009 look at the ascii character codes.... $in = "èïabcå helloü" $aSplit = StringSplit ($in, "") For $i = 1 to $aSplit[0] If asc ($aSplit[$i]) > 127 Then $in = StringReplace ($in, $aSplit[$i], "?") ; replace char. Next MsgBox (0, "result", "result is: " & @CRLF & $in) untested code but the theory should be good! MDiesel AutoIt Project Listing
lafafmentvotre Posted July 17, 2009 Author Posted July 17, 2009 Hello doesn't work for my need. the result is : ??abc? hello? i want to know how replace : é by e ù by u à by a ...... Any solution ? Thanks
Spiff59 Posted July 17, 2009 Posted July 17, 2009 Local $aConvert[7][2] = [["[àáâãäå]","a"],["[éèêë]","e"],["[ìíîï]","i"],["ñ","n"],["[òóôõö]","o"],["[ùúûü]","u"],["[ýÿ]","y"]] $in = "èïabcåñ heýýoü" For $i = 0 to 6 $in = StringRegExpReplace($in, $aConvert[$i][0], $aConvert[$i][1]) Next MsgBox (0, "result", $in)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now