On Tuesday, October 1, 2013 1:57:43 PM UTC-5, Ayers, Mike wrote:
>
> > From: puppet...@googlegroups.com <javascript:> [mailto:puppet-<javascript:> 
> > us...@googlegroups.com <javascript:>] On Behalf Of Peter Berghold 
>
> > What does "Could not prefetch package provider 'apt': invalid byte 
> > sequence in US-ASCII" mean exactly?  This started showing up in the logs 
> > of some of my servers... 
>
>         If a file is being interpreted as US-ASCII, then it is expected to 
> have no characters with the high bit set.  If you edited any source files 
> with an Unicode editor, it may have changed some of your punctuatiuon to 
> fancy Unicode versions of that punctuation (e.g. a pair of quotes to "left 
> quote" and "right quote"), which the interpreter would not understand. 
>
>         Blind stab: If you save a file as type "UTF-8" on Windows, a BOM 
> will be inserted as the first character in the file.  Make sure you save as 
> ASCII. 
>
>

Yes, a byte-order mark at the beginning of the file is the most likely 
culprit.   Note that UTF-8 does not require a BOM, so removing one will not 
invalidate the file, though it may make life harder for code that tries to 
detect the encoding.  But by that token, no encoding detection appears to 
be happening anyway, otherwise the file would not be assumed US-ASCII.  If 
the only bytes having their high bit set appear in a BOM at the start of 
the file, then removing the BOM will make the file simultaneously valid 
UTF-8, valid US-ASCII, and valid ISO-8859-x, x = 1 ... 15.

Note, too, that although Windows editors are known for adding a BOM under 
certain circumstances, modern vim (and I assume emacs) understand Unicode 
encodings, including UTF-8, and can probably be induced to add a BOM 
themselves.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to