Copy link to clipboard
Copied
I am using the following to replace Muñoz (the ñ with null) . It should output as Muoz.
This should be simple but it is not working. 209 and 241 represent the upper and lower case ñ.
This statement is in a CFFILE. I am generating the file but the ñ is still there.
replace(LGL_NM,chr(209)&chr(241),'3','all')
I also tried the following without success:
<cfset x = ReplaceNoCase(#Object_query.LGL_NM#,"#chr(209)#", " ", "all")>
<cfset LGL_NM = ReplaceNoCase(x,"#chr(241)#", " ", "all")>
Please Help.
Thanks!
Bill
<!--- sets the encoding to UTF-8 --->
<cfprocessingdirective pageencoding="utf-8">
<cfset testString="muñaÑoz">
<!--- Replace any character match in the regular expression [ñÑ] with a blank string--->
<cfoutput>#REReplaceNoCase(testString, "[#chr(209)##chr(241)#]", "", "all")#</cfoutput>
Copy link to clipboard
Copied
When I try what you pasted, I get "Mu oz" in the file. The n is missing. Not sure why it's not working for you. Maybe a charset thing? I'm using iso-8859-1
Copy link to clipboard
Copied
Thanks for the response Paul.
Where is the character set defined? How do I know what I am using?
Thanks again.
Bill
Copy link to clipboard
Copied
I mean on the page itself, in the meta tag. Not sure if it's what's causing the difference though.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Copy link to clipboard
Copied
<!--- sets the encoding to UTF-8 --->
<cfprocessingdirective pageencoding="utf-8">
<cfset testString="muñaÑoz">
<!--- Replace any character match in the regular expression [ñÑ] with a blank string--->
<cfoutput>#REReplaceNoCase(testString, "[#chr(209)##chr(241)#]", "", "all")#</cfoutput>
Copy link to clipboard
Copied
Thank You! That worked!
Bill
Copy link to clipboard
Copied
OK. Good luck.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now