tracker issue : CF-4150357

select a category, or use search below
(searches all categories and all time range)
Title:

ReplaceNoCase fails to replace properly with special char "ß"

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): e-domizil License Team / e-domizil License Team (Alexander Hass)

Created: 05/09/2016

Components: Functions, String

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: ALL / Win 2012 Server x64

Vote Count: 0

Listed in the version 2016.0.02.299200 Issues Fixed doc
Problem Description: If you replace a string with "ß" (german special char) this replace fails and ends with some brackets and the number

Steps to Reproduce:

<cfprocessingdirective pageencoding = "utf-8" />

SPECIAL CHAR "ß" FAILS:<br/>
<cfset local.text ="ß {1}r"  />
<cfset local.testnc = ReplaceNoCase(local.text,"{1}","TEXT","all") /> <!--- -> Incorrect result 'ß {TEXT' --->
<cfset local.test = Replace(local.text,"{1}","TEXT","all") /> <!--- -> Correct result 'ß TEXT'  --->

<cfoutput>ReplaceNoCase: "#local.testnc#" (FAIL)</cfoutput><br>
<cfoutput>Replace: #local.test# (WORKS)</cfoutput><br />

<br />
WORKS:<br>
<cfset local.text ="a {1}r"  />
<cfset local.testnc = ReplaceNoCase(local.text,"{1}","TEXT","all") /> <!--- -> Correct result 'a TEXT'  --->

Other special chars:</br>
<cfset local.text ="äüö {1}r"  />
<cfset local.testnc = ReplaceNoCase(local.text,"{1}","TEXT","all") /> <!--- -> Correct result 'äüö TEXT'  --->

<cfoutput>ReplaceNoCase: #local.testnc#</cfoutput><br>
Actual Result:

Expected Result:

With "ß" we expect this string to me  'ß TEXT'

Any Workarounds: NO workaround known.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4150357

External Customer Info:
External Company:  
External Customer Name: Firstname Lastname
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

User issue is correct. I tried above code and result is incorrect as mentioned. I tried below code also: <cfprocessingdirective pageencoding = "utf-8" /> SPECIAL CHAR "ß" FAILS:<br/> <cfset local.text ="ß pr" /> <cfset local.testnc = ReplaceNoCase(local.text,"p","TEXT","all") /> <!--- -> Incorrect result 'ß {TEXT' ---> <cfset local.test = Replace(local.text,"{1}","TEXT","all") /> <cfoutput>#local.testnc#</cfoutput> Output is:: SPECIAL CHAR "ß" FAILS: ß pTEXT Result is weird when This special character is preceding the string that is to be replaced. Marking the bug as tofix.
Comment by Poonam J.
2894 | May 09, 2016 10:34:19 PM GMT
The issue can be seen if the cfm file is running "utf8 without BOM" encoding.
Comment by Sandip H.
2895 | May 16, 2016 01:34:33 PM GMT
Integrated to HF2.
Comment by Krishna R.
2896 | May 19, 2016 08:29:34 AM GMT
test note
Comment by CFwatson U.
2897 | June 07, 2016 04:17:04 AM GMT
The fix for this bug is available as part of the early-access build for ColdFusion 2016 Update 2.
Comment by CFwatson U.
2898 | June 07, 2016 04:23:48 AM GMT