# Chinese display

**URL:** <https://www.ruby-forum.com/t/chinese-display/111868>\
**Category:** Ruby\
**Created:** [August 12, 2007, 6:31pm UTC](https://www.ruby-forum.com/t/chinese-display/111868 "2007-08-12T18:31:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [August 12, 2007, 6:31pm UTC](https://www.ruby-forum.com/t/chinese-display/111868/1 "2007-08-12T18:31:49Z")

</div>

hello:  
I have built a project with Instant Rails.Now only a database and a  
scaffold based on a product model have finished.But when i inputted  
“…/admin/list” in my browser,i found my chinese characters cound not  
display normally.Then i made five steps:  
1 ajusting encoding in my browser menu  
2 in “C:\InstantRails\conf\_files\my.ini"directory,making sure  
“my.ini” file containg “[mysqld] default-character-set=utf8  
[client] default-character-set=utf8” setting.  
3 adding “encoding: utf8” in my “config/database.yml” file  
4 making all the “.rtml"and”.rb” files saved in “utf8” way  
5 deleting my database and rebuilding the database  
When i made my “three” migration using “rake db:migrate”,an error  
displayed in my console window saying “001\_create\_products.rb:14:syntax  
error, unexpected kEND,expecting $end”.  
How do i manage this problem?  
More important,i want to know how can i make my app to display  
chinese correctly.  
thank you!

---

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [August 12, 2007, 6:42pm UTC](https://www.ruby-forum.com/t/chinese-display/111868/2 "2007-08-12T18:42:09Z")

</div>

On 8/12/07, Guo Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> When i made my "three" migration using "rake db:migrate",an error
> 
> ```
> 
> displayed in my console window saying “001\_create\_products.rb:14:syntax  
> error, unexpected kEND,expecting $end”.  
> How do i manage this problem?  
> More important,i want to know how can i make my app to display  
> chinese correctly.  
> thank you!

Well as far as proper display of chinese, can’t help you there, although  
you  
may also want to consider that you need to be sending the correct  
character  
encoding at the http level as well (either with a header or meta tag).  
But  
that error just means you have an extra “end” at the end of that  
file  
001\_create\_products.rb. Try deleting it.

---

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [August 13, 2007, 10:22am UTC](https://www.ruby-forum.com/t/chinese-display/111868/3 "2007-08-13T10:22:20Z")

</div>

On Aug 12, 2007, at 11:41 AM, Logan C. wrote:

> –
> 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

For language display, encoding is the first obvious part, but the  
font being used must also support the characters in the code ranges  
of the encoding. OP is using rails which is all defaulted to UTF8 so  
encoding is not the problem there.  
Likely, it is the fonts, however you should also make sure your  
editor is also set to UTF8 for your text files.
