The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #11303

Puppet should support UTF-8 comments in manifests

Added by Anonymous over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:12/08/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:utf8
Target version:2.7.9
Affected Puppet version:2.7.6 Branch:
Keywords:utf8 comment manifest internationalization paying support

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


Description

Overview

Upon investigating #10291 I realize that ticket describes two separate issues. The UTF-8 non breaking space issue will remain in that ticket. The unicode character in comments issue will be tracked in this ticket.

The issue is that Puppet 2.7.6 with Ruby 1.9.2 and unset LANG and LC_CTYPE environment variables will default to an encoding of ASCII-8BIT. This environment produces an error when parsing a manifest that contains UTF-8 characters in a comment.

$ cat test.pp 
class test { 
# sysadmin´s 
} 

$ od -c test.pp 
0000000 c l a s s t e s t { \n 
0000020 # s y s a d m i n 302 264 s \n } 
0000040 \n 
0000041 

$ echo $LANG 
en_US.UTF-8
$ puppet parser validate test.pp 
$ unset LANG 
$ puppet parser validate test.pp 
err: Could not parse for environment production: invalid byte sequence in US-ASCII at /tmp/test.pp:1 
err: Try 'puppet help parser validate' for usage

Related issues

Related to Puppet - Bug #19731: Cron name with extended characters could lead to state ya... Closed
Related to Puppet - Bug #20522: Improve Puppet's handling of non-ASCII character encodings Accepted
Related to Puppet - Bug #21806: Puppetmaster 3.2.3-1puppetlabs1 not working with non-asci... Closed
Related to Puppet - Bug #19655: "invalid byte sequence" with service provider upstart Needs Decision
Duplicated by Puppet - Bug #21751: Error 400 on SERVER: "\xC5" on US-ASCII on tring to retri... Duplicate

History

#1 Updated by Anonymous over 4 years ago

  • Status changed from Accepted to Closed

Closed – Not a Bug

After some more investigation into this problem, Puppet is currently behaving as expected and this isn’t actually a bug or 1.9 incompatibility. We haven’t yet made the decision to switch the entire system to UTF-8. As a result, Puppet will honor whatever encoding your environment specifies with the LANG or LC_CTYPE environment variables. If you do not set these environment variables to match the encoding format of your Puppet manifests the parser validation error is expected because Puppet will default to expecting ASCII encoding.

Work Around

Please make sure you set LC_CTYPE or LANG to the encoding you’re using in your puppet manifests. For parser validation, a wrapper script will help and can ensure your encodings match up to what you expect. Also of note, UTF-8 is backwards compatibile with ASCII so you may simply want to set UTF-8 in your environment.

-Jeff

Also available in: Atom PDF