Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

yield_content not keeping original encoding? #68

Open
wielgosm opened this Issue · 1 comment

2 participants

Mark Tepper matee911
Mark Tepper

Hi,

I am using content_for in my application. In one of my documents I am using the following character in one of my erb files: '×'.

I have the following declarations in my app:

    Encoding.default_external = Encoding::UTF_8
    Encoding.default_internal = Encoding::UTF_8

All my documents are utf-8. My locale is the following:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Using erb to output stuff seems to be working ok, for example (just for hand-debugging):

<% content_for :messages_and_contents do |file| %>
  <%=erb :'parts/messages'%>
  <%p erb(:'parts/messages').encoding.to_s%>
  <%=erb file%>
  <%p erb(file).encoding.to_s%>
<% end %>

Both output strings to the console give me UTF-8.

Using yield_content seems to break things. For example:

yield_content(:messages_and_contents,file)

...The output string for yield_content is US-ASCII.

Is something wrong on my side or is yield_content at fault here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.