Details
Description
UTF-8 files produced on Windows often contain a BOM. Puppet now reads most files as utf-8, but doesn't allow for them to have a leading BOM.
This can be a problem for end users on Windows, where they might need to go through workarounds to produce content without a BOM. For instance, PowerShell can write files as UTF-8 with the Out-File cmdlet, specifying -Encoding UTF8 - but the files are written with a BOM, which ends up blowing up Ruby if we try to read the files in Puppet (under certain circumstances).
An easy solution is to modify any calls specifying utf-8 when opening files for read, to instead specify bom|utf-8. Ruby will handle the BOM correctly in this case.
Note that the Ruby YAML.load_file API already handles the BOM situation correctly, so YAML files will generally be excluded from this problem.
Attachments
Issue Links
- duplicates
-
MODULES-1996 PowerShell module doesn't recognize elseif
-
- Closed
-
- relates to
-
PA-5188 Puppet should recognize BOM in a hosts file
-
- Accepted
-
-
PUP-5819 Lexer should raise a better error when loading manifest files containing a UTF-8 BOM (Byte Order Mark)
-
- Closed
-
-
PUP-8243 Allow ERB templates to be tolerant of a leading BOM
-
- Resolved
-
- mentioned in
-
Page Loading...