Ticket #783 (closed defect: fixed)
Patch for builder.rb error: invalid byte sequence in US-ASCII
| Reported by: | slewsys@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | major | Milestone: | MacRuby 0.8 |
| Component: | MacRuby | Keywords: | |
| Cc: |
Description
As of MacRuby subversion Revision: 4343, following build instructions per ./README.rdoc fails with error message "invalid byte sequence in US-ASCII". This is a known issue with Ruby 1.9 which can be resolved by adding an argument to IO.open/read. In the case of MacRuby's builder.rb, changing File.read(src) to File.read(src, { :mode => "rb" }) resolves the issue. Patch follows:
Index: rakelib/builder/builder.rb
===================================================================
--- rakelib/builder/builder.rb (revision 4343)
+++ rakelib/builder/builder.rb (working copy)
@@ -142,7 +142,7 @@
end
def locate_headers(cont, src)
- txt = File.read(src)
+ txt = File.read(src, { :mode => "rb" })
txt.scan(/#include\s+\"([^"]+)\"/).flatten.each do |header|
p = header_path(header)
if p and !cont.include?(p)
Change History
Note: See
TracTickets for help on using
tickets.

