tracker issue : CF-4020259

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

ReplaceNoCase throws String index out of range

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Daniel Mackey / Daniel Mackey (Daniel Mackey)

Created: 07/13/2015

Components: Core Runtime

Versions: 11.0

Failure Type: Crash

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / All users will encounter

Locale/System: ALL / Win 2008 Server R2

Vote Count: 0

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 05, 2017 using build 2016.0.01.298513
Problem Description:

Call ReplaceNoCase( "?rtibat Kurma" , "Kurma" ,"","one") and string index out of range is thrown

Steps to Reproduce:

Run this ReplaceNoCase( "?rtibat Kurma" , "Kurma" ,"","one")

Actual Result:
String index out of range

Expected Result:

Any Workarounds:

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

Watson Bug ID:	4020259

External Customer Info:
External Company:  
External Customer Name: Daniel
External Customer Email:  
External Test Config: My Hardware and Environment details: Windows Server 2008 RC2,



Also updated CF9.02 to JDK 1.7 and getting the same issue on that box.
Comment by External U.
6677 | July 13, 2015 09:03:17 AM GMT
You may need to add <cfprocessingdirective pageEncoding="utf-8"> to the template to get this or safe your file as UTF8 so CF11 picks it up as UTF-8 Here is another example of where it's going wrong: <cfoutput>#ReplaceNoCase( "?rtibat Kurma Kurma Kurma" , " " , "_", "ALL")#</cfoutput> You could expect an output of "?rtibat_Kurma_Kurma_Kurma" but instead you get "?rtibat _urma _urma _urma" From the stack trace, ReplaceNoCase seems to send a map to Replace which is then tries to replace a sub string. The double byte char in the string is giving the wrong position to replace on. While this exists in CF11 and CF10, and I know CF9 is EOL, you can get the same result in CF9 by updating to JDK 1.7_79 (Which is meant to be certified for CF9) Dan.
Comment by External U.
6678 | July 13, 2015 01:13:27 PM GMT
This issue is fixed and the fix for this issue will be available as part of next major release of ColdFusion.
Comment by Nimit S.
6679 | September 24, 2015 07:55:48 AM GMT
How about the issue be fixed in the CURRENTLY SUPPORTED versions of ColdFusion? This is affecting people using CF10 and CF11 also
Comment by External U.
6680 | January 28, 2016 08:46:04 AM GMT
Verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
6681 | August 05, 2017 11:19:33 PM GMT