On Jan 8, 4:22 pm, Phrogz <[email protected]> wrote: > Am I doing something incorrect in the following? > > haml = IO.read( layout ) > template = Haml::Engine.new( haml, HAML_OPTIONS ) > result = template.render > ( Object.new, :contents=>contents, :page=>self, :global=>@bundle.toc ) > > p RUBY_VERSION, RUBY_PLATFORM, > Encoding.default_external, Encoding.default_internal, > haml.encoding, HAML_OPTIONS, result.encoding > > "1.9.1" > "i386-mingw32" > #<Encoding:UTF-8> > #<Encoding:UTF-8> > #<Encoding:UTF-8> > {:format=>:html4, :ugly=>true, :encoding=>"UTF-8"} > #<Encoding:ASCII-8BIT>
Ack, the result of posting the question of course led me to the answer. This is *not* Haml's fault. The 'contents' String passed as a local to the template turned out to be ASCII-8BIT. (BlueCloth 2.0.5 took a UTF-8 string and handed me back ASCII-8BIT. I'll take it up with BlueCloth.) It would be /nice/ if Haml performed the equivalent of encode ( ..., :undef=>:replace ) on the result (not the incoming strings) when an encoding is requested, but understandable that it doesn't. Sorry for the noise; hopefully this will help someone else with a similar problem.
-- 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.
