Bug 50568

Summary: Function __FileToString(): Could not read file when encoding option is blank/empty
Product: JMeter - Now in Github Reporter: Milamber <milamber>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.4   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Patch

Description Milamber 2011-01-10 16:20:44 UTC
When you use __FileToString() function without add a encoding charset to read the file, JMeter generate this error in jmeter.log :

2011/01/10 20:41:52 WARN  - jmeter.functions.FileToString: Could not read file: /home/milamber/file.txt  
2011/01/10 20:41:52 INFO  - jmeter.threads.JMeterThread: Stopping Thread: org.apache.jorphan.util.JMeterStopThreadException: End of sequence 
2011/01/10 20:41:52 INFO  - jmeter.threads.JMeterThread: Stop Thread detected by thread: Groupe d'unités 1-1 

${__FileToString(/home/milamber/file.txt,,MY_FILE)}

If you add a charset, no error.
${__FileToString(/home/milamber/file.txt,UTF-8,MY_FILE)}



Thanks to Fabrice B. from French user group to catch this bug.
Comment 1 Milamber 2011-01-10 16:21:35 UTC
Created attachment 26473 [details]
Patch
Comment 2 Milamber 2011-01-10 16:27:17 UTC
Fixed.

URL: http://svn.apache.org/viewvc?rev=1057376&view=rev
Log:
Bug 50568 - Function __FileToString(): Could not read file when encoding option is blank/empty

Modified:
    jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/FileToString.java
    jakarta/jmeter/trunk/xdocs/changes.xml
Comment 3 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2450