tracker issue : CF-4198841

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

[Linux] expandPath() encoding of filenames lost when using absolute path as argument

| View in Tracker

Status/Resolution/Reason: To Track//PRNeedInfo

Reporter/Name(from Bugbase): Sebastian Thomas / Sebastian Thomas ()

Created: 06/07/2017

Components: File Management

Versions: 2016,11.0,13.0

Failure Type: Data Loss

Found In Build/Fixed In Build: 2016.0.04.302561 /

Priority/Frequency: Major / All users will encounter

Locale/System: ALL / Linux Red Hat 7.0

Vote Count: 5

Problem Description:
expandpath() loses UTF-8 encoding when using absolute path (starting with `/`) as argument. Encoding is kept when beginning the path with a `.` (dot).

Steps to Reproduce:
<cfdump var="#expandpath("/test-öäü.txt")#" />

Actual Result:
/your/path/to/cfm/test-???.txt

Expected Result:
/your/path/to/cfm/test-öäü.txt

Any Workarounds:
none

Attachments:

Comments:

Pls fix this asap.
Vote by Simon Rudat
612 | June 08, 2017 12:12:42 PM GMT
Hi Sebastian, In Windows, jvm by default uses iso-8859-1 encoding in which the characters öäü are present. Whereas, In Linux we have to use the utf-8 encoding for these characters to work and the file needs to be saved using utf-8 encoding. <cfprocessingdirective pageencoding="utf-8"> <cfdump var="#expandpath("/test-öäü.txt")#" /> Thanks, Mukesh
Comment by Mukesh Kumar
609 | August 01, 2017 07:42:21 AM GMT
Hi Mukesh, that would make sense if expandpath() would behave the same for paths starting with "/" and paths not starting with "/". Example: <cfdump var="#expandpath("/test-öäü.txt")#" /> <!--- output: /path/to/test-???.txt ---> <cfdump var="#expandpath("test-öäü.txt")#" /> <!--- output: /path/to/test-öäü.txt ---> Could you investigate more please? Thanks, Sebastian
Comment by Sebastian Thomas
610 | August 01, 2017 09:03:58 AM GMT
Same behaviour with Build 2016.0.05.303689
Comment by Sebastian Thomas
611 | October 11, 2017 09:20:09 AM GMT
Hi Sebastian , I tried in build#2016,0,07,312270 and find the expected behavior : <cfprocessingdirective pageencoding="utf-8"> <cfdump var="#expandpath("/test-öäü.txt")#" /><br> <!--- output: /path/to/test-öäü.txt ---> <cfdump var="#expandpath("test-öäü.txt")#" /><br>  <!--- output: /path/to/test-öäü.txt ---> Please make sure the file has to be saved using utf-8 encoding. Can you please try on latest update and let us know .   Thanks, Mukesh  
Comment by Mukesh Kumar
30005 | December 05, 2018 09:58:45 AM GMT