# Render :text =\> ... encoding error?

**URL:** <https://www.ruby-forum.com/t/render-text-encoding-error/143054>\
**Category:** Rails\
**Created:** [July 14, 2008, 8:56pm UTC](https://www.ruby-forum.com/t/render-text-encoding-error/143054 "2008-07-14T20:56:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [July 14, 2008, 8:56pm UTC](https://www.ruby-forum.com/t/render-text-encoding-error/143054/1 "2008-07-14T20:56:08Z")

</div>

render :text =\> “stuff \<#{@app || ‘no app’}\>”

displays in browser as “stuff” (no quotes)

this occurs independent of whether @app has a value, and either way,  
the “\<” and “\>” should be rendered.

i haven’t an idea what is causing this; could it be an encoding issue,  
or a bug of some sort?

the only workaround I have found is that

render :text =\> “stuff \< #{@app || ‘no app’}\>”

i.e. insertion of a space between “\<” and “#” will properly render:

stuff \< no app\>

wierd. any ideas?

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [July 14, 2008, 10:21pm UTC](https://www.ruby-forum.com/t/render-text-encoding-error/143054/2 "2008-07-14T22:21:28Z")

</div>

On Jul 14, 7:55 pm, Jim C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> render :text =\> “stuff \<#{@app || ‘no app’}\>”
> 
> displays in browser as “stuff” (no quotes)
> 
> this occurs independent of whether @app has a value, and either way,  
> the “\<” and “\>” should be rendered.

\< and \> are special characters in html, what you are producing is  
invalid html (which leaves you at the browser’s mercy).

Fred

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [July 14, 2008, 10:25pm UTC](https://www.ruby-forum.com/t/render-text-encoding-error/143054/3 "2008-07-14T22:25:34Z")

</div>

render :text =\> “stuff \<#{@app || ‘no app’}\>”

On Jul 14, 4:20 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
