I can't quite track down whether this is Rails, passenger, or haml...  
obviously it only happens on Ruby 1.9...

Just FYI I tried fixing it by using a suggestion on the passenger  
forum whereby you start passenger with:

PassengerRuby /usr/local/bin/ruby_wrapper

::/usr/local/bin/ruby_wrapper

#!/usr/bin/sh
/opt/local/bin/ruby1.9 -E UTF-8:UTF-8 "$@"
or
/opt/local/bin/ruby1.9 -E ASCII-8BIT:ASCII-8BIT  "$@"

Neither of which made any difference.

The only possible answer I have to the intermittent-ness is that maybe  
the 'template' is being cached somewhere for a short time and as the  
cache expires you get the collision.

I'm stumped and don't have time to investigate more.

Thanks for hard work,
-Adam

On 23/07/2009, at 1:22 PM, Nathan Weizenbaum wrote:

> I don't know why this would be intermittent either... I'll look into  
> the line-reporting error, too. In fact, the Haml template should  
> have been UTF-8 encoded.
>
> On Wed, Jul 22, 2009 at 6:29 PM, Adam Salter  
> <[email protected]> wrote:
> I've found the problem...
>
> In a erb file that was included via 'yield' (ie the file for the  
> action) was a invisible character which had URL encoding value of  
> "%C2%A0" or HTML encoding value of "&nbsp;"
>
> I'm not sure why this was intermittent, or why haml reported the  
> error about 8 lines below the yield...
> The yield was on line 169, the reported error was:
>
>   Showing app/views/layouts/application.html.haml where line #177  
> raised:
>   incompatible character encodings: ASCII-8BIT and UTF-8
>
> The incompatible char was on line 10 of the erb file.
>
> -Adam
>
> On 23/07/2009, at 2:40 AM, Nathan Weizenbaum wrote:
>
>> What version of Haml are you running?
>>
>> On Wed, Jul 22, 2009 at 8:36 AM, Adam Salter  
>> <[email protected]> wrote:
>>
>> I'm trying to migrate my local dev environment to Ruby 1.9
>> and I'm getting some strange encoding errors trying to display some
>> haml templates
>>
>> "incompatible character encodings: ASCII-8BIT and UTF-8"
>>
>> The weird thing is that the errors only happen intermittently:
>> I'm using passenger to serve pages...
>>
>> Interestingly I don't get the encoding errors serving the files using
>> WebBrick...
>>
>> The errors are also on weird lines like:
>>
>> 174:         %li
>> 175:           %ul
>> 176:             %li
>> 177:               = link_to "Home", home_path
>>
>> It's hardly complicated... and doesn't involve any hits to the
>> database... home_path actually resolves to '/' which is the same char
>> in ASCII and UTF8??
>>
>> Any suggestions most welcome,
>> Cheers,
>>
>>
>>
>>
>>
>
>
>
>
>
>
> >
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" 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/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to