# 1.8 to 1.9 compatibility

**URL:** <https://www.ruby-forum.com/t/1-8-to-1-9-compatibility/156789>\
**Category:** Ruby\
**Created:** [January 2, 2009, 10:30pm UTC](https://www.ruby-forum.com/t/1-8-to-1-9-compatibility/156789 "2009-01-02T22:30:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![flatekmonkey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/e8c25b/32.png) [@flatekmonkey](https://www.ruby-forum.com/u/flatekmonkey)\
**Post date:** [January 2, 2009, 10:30pm UTC](https://www.ruby-forum.com/t/1-8-to-1-9-compatibility/156789/1 "2009-01-02T22:30:12Z")

</div>

As I said in the former thread, I have given some thoughts on this.  
But I am not a guru and I would like many more opinions on this.

90% of the possible things are quite trivial or easy, like using  
enumerator, defining methods like String#to\_bytes or Integer#pred.  
I do not really know where the main difficulties are, Fibers cannot be  
done easily and I assume that a Thread based fiber implementation  
might be ultra slow.

Cheers  
Robert

---

<div class="post-metadata">

**Author:** ![flatekmonkey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/e8c25b/32.png) [@flatekmonkey](https://www.ruby-forum.com/u/flatekmonkey)\
**Post date:** [January 2, 2009, 11:25pm UTC](https://www.ruby-forum.com/t/1-8-to-1-9-compatibility/156789/2 "2009-01-02T23:25:08Z")

</div>

Robert D. wrote:

> As I said in the former thread, I have given some thoughts on this.  
> But I am not a guru and I would like many more opinions on this.
> 
> 90% of the possible things are quite trivial or easy, like using  
> enumerator, defining methods like String#to\_bytes or Integer#pred.  
> I do not really know where the main difficulties are, Fibers cannot be  
> done easily and I assume that a Thread based fiber implementation  
> might be ultra slow.
> 
> Cheers  
> Robert

Maybe someone can do a summary… I myself am struggling with it,  
especially the encodings. This gives me headache, for .rb files which  
worked flawlessly with ruby 1.8.x now give me US ASCII errors. ☹

---

<div class="post-metadata">

**Author:** ![flatekmonkey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/e8c25b/32.png) [@flatekmonkey](https://www.ruby-forum.com/u/flatekmonkey)\
**Post date:** [January 2, 2009, 11:38pm UTC](https://www.ruby-forum.com/t/1-8-to-1-9-compatibility/156789/3 "2009-01-02T23:38:13Z")

</div>

On Jan 2, 2009, at 4:24 PM, Marc H. wrote:

> Maybe someone can do a summary… I myself am struggling with it,  
> especially the encodings. This gives me headache, for .rb files which  
> worked flawlessly with ruby 1.8.x now give me US ASCII errors

If a file contains any characters with the top bit set, you now have  
to tell Ruby what encoding that file is in. For example, if you  
include a utf-8 em-dash (—), you’d need to add the comment

# encoding: utf-8

puts “No way—Way!”

to the top of the file.

Each file in an application can have its own encoding.

Dave
