How to get unicode support in ruby

Hi All,

Please let detail description how to achieve unicode support in

ruby.

Thanks,
Nandan

I don’t know what’s your concrete problem. Maybe you could try to write:

encoding: utf-8

at the beginning of the ruby file. Source:
http://stackoverflow.com/a/2105210/507018

2012/9/4 nandan k. [email protected]

On Tue, Sep 4, 2012 at 9:06 AM, nandan k. [email protected] wrote:

Please let detail description how to achieve unicode support in

ruby.

http://lmgtfy.com/?q=unicode+ruby

nandan k. wrote in post #1074613:

Please let detail description how to achieve unicode support in

ruby.

https://github.com/candlerb/string19/blob/master/string19.rb

It contains links to other documents too.

Hello,

I see that shebang:
#!/usr/bin/env ruby

doesn’t work if not on the first line. Same goes for UTF-8:

encoding: utf-8

needs to be the first one to get accepted.

Is there a way to combine both? To avoid having program.rb ? I like more
‘program’ + shebang.

Best Regards

On 4 Σεπ 2012, at 22:51 , Brian C. [email protected] wrote:

Panagiotis A.

On 09/04/2012 03:28 PM, Panagiotis A. wrote:

Hello,

I see that shebang:
#!/usr/bin/env ruby

doesn’t work if not on the first line. Same goes for UTF-8:

encoding: utf-8

needs to be the first one to get accepted.

This is incorrect. If the first line of the file is a shebang line, the
encoding line may follow it on the second line.

Is there a way to combine both? To avoid having program.rb ? I like more
‘program’ + shebang.

Yes, put the shebang line first and follow it with the encoding line.
:slight_smile:

-Jeremy

Hello,

Yes you’re write, it must be in the 2nd line though, if it’s in the 3rd
like:

#!/usr/bin/env ruby

encoding: UTF-8

Doesn’t work :slight_smile:

must be:

#!/usr/bin/env ruby

encoding: UTF-8

thanks :slight_smile:

On 4 Σεπ 2012, at 23:44 , Jeremy B. [email protected] wrote:

needs to be the first one to get accepted.

Panagiotis A.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs