Issue #10291 has been updated by Jeff McCune.

Subject changed from UTF8 non-breaking space in a manifest breaks the parser to 
Puppet manifests should fully support UTF-8 character encoding

# Expanding the subject #

I'm going to expand the scope on this because it's not only non-breaking spaces 
that cause problems.  Another support customer reports the following issue:

<pre>
$ 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
</pre>

Our parser does not deal with non breaking spaces and UTF-8 characters in 
comments at the least.

I'm debating proposing we should switch the entire Puppet source code base to 
UTF-8 encoding as well which will be a 3rd ticket...

-Jeff
----------------------------------------
Bug #10291: Puppet manifests should fully support UTF-8 character encoding
https://projects.puppetlabs.com/issues/10291

Author: Oliver Hookins
Status: Accepted
Priority: Normal
Assignee: Jeff McCune
Category: ruby19
Target version: 
Affected Puppet version: 2.6.7
Keywords: 
Branch: 


<code>
err: Could not parse for environment production: Could not match  Yum::Repo at 
/home/ohookins/svn/redacted/repo.pp:4
</code>

The actual code is unremarkable, but the problem is here:

<code>
00000020  20 7b 0a 20 c2 a0 59 75  6d 3a 3a 52 65 70 6f 20  | {. ..Yum::Repo |
00000030  7b 0a 20 c2 a0 c2 a0 c2  a0 6d 65 74 61 64 61 74  |{. ......metadat|
</code>

Somehow we've ended up with a UTF8 "nbsp" in our manifest (the 0xc2a0). Sure, I 
can just remove these characters but it suggests to me that perhaps the Unicode 
support in the parser is incomplete, which is a larger problem for 
internationalisation.




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to