# Strange rhtml template compile error

**URL:** <https://www.ruby-forum.com/t/strange-rhtml-template-compile-error/155703>\
**Category:** Ruby\
**Created:** [December 15, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/strange-rhtml-template-compile-error/155703 "2008-12-15T19:11:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![molla5](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e0b2c6/32.png) [@molla5](https://www.ruby-forum.com/u/molla5)\
**Post date:** [December 15, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/strange-rhtml-template-compile-error/155703/1 "2008-12-15T19:11:07Z")

</div>

Hi,  
I have the following statement inside an rhtml file

%=“ÄŸÄžÄŸ”%\>

These chars are from ISO-8859-9 and their byte values are F0, D0, F0  
respectively, which are “LATIN SMALL LETTER G WITH BREVE” and “LATIN  
CAPITAL LETTER G WITH BREVE”.

When I run this code it gets:

compile error  
C:/test/app/views/test/work.rhtml:1: unterminated string meets end of  
file  
C:/test/app/views/test/work.rhtml:1: syntax error, unexpected $end,  
expecting ‘)’

Extracted source (around line #1):

1: \<%=“ï¿½ï¿½ï¿½”%\>

However when I debug the code using rdebug, I see that the following  
code  
in action\_view\template\_handlers\compileable.rb is called.

ActionView::Base::CompiledTemplates.module\_eval(render\_source,  
file\_name, -line\_offset)

Here the value of render\_source printed by the debugger is as follows:

“def \_run\_erb\_47app47views47test47work46rhtml(local\_assigns)\n\_erbout =  
‘’; \_erb  
out.concat((“Â­-ÂºÂ­-”).to\_s); \_erbout\nend”  
^ ^  
| |---- it does not escape here  
|---- here it escapes " but

The strange thing I noticed is above, where it escapes the first double  
quote but not the second.

I thougt that the debugger may not be interpreting the characters  
correctly so checked the byte values by evaluating by hand like  
render\_source[91], render\_source[92], render\_source[93]. It gave me  
correct values as 240, 208 and 240 again. However, module\_eval keeps  
giving compilation error although I cannot see and appearant reason why  
is fails.

Can someone shed some light on it?

Thanks.
