[JIRA] (JENKINS-58835) recognize file's encodings

2019-08-06 Thread ilaty...@yahoo.ca (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ilguiz Latypov commented on  JENKINS-58835  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: recognize file's encodings   
 

  
 
 
 
 

 
 Related to JENKINS-53901.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.201150.1565131115000.9354.1565131260050%40Atlassian.JIRA.


[JIRA] (JENKINS-58835) recognize file's encodings

2019-08-06 Thread ilaty...@yahoo.ca (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ilguiz Latypov created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-58835  
 
 
  recognize file's encodings   
 

  
 
 
 
 

 
Issue Type: 
  Improvement  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 workflow-basic-steps-plugin  
 
 
Created: 
 2019-08-06 22:38  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Ilguiz Latypov  
 

  
 
 
 
 

 
 It would be nice if the readFile basic step could recognize the file's encoding.  (Writing a file with writeFile can store a BOM at the beginning to help in recognizing the character set later, but this must be only a non-default option to preserve backward compatibility with earlier groovy code reading the created files.  This agrees with a rule of thumb "accept liberally, produce conservatively"). There is no need to reinvent the wheel.  Using (and white-listing) groovy.util.CharsetToolkit can make this easy.   https://github.com/groovy/groovy-core/blob/GROOVY_2_4_X/src/main/groovy/util/CharsetToolkit.java#L388   http://docs.groovy-lang.org/latest/html/api/groovy/util/CharsetToolkit.html#getReader()   https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/workflow-basic-steps-2.18/src/main/java/org/jenkinsci/plugins/workflow/steps/ReadFileStep.java    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment