# Marshal error with nom ascii chars

**URL:** <https://www.ruby-forum.com/t/marshal-error-with-nom-ascii-chars/177974>\
**Category:** Ruby\
**Created:** [October 27, 2009, 12:50pm UTC](https://www.ruby-forum.com/t/marshal-error-with-nom-ascii-chars/177974 "2009-10-27T12:50:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcelocavaco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e56c9b/32.png) [@marcelocavaco](https://www.ruby-forum.com/u/marcelocavaco)\
**Post date:** [October 27, 2009, 12:50pm UTC](https://www.ruby-forum.com/t/marshal-error-with-nom-ascii-chars/177974/1 "2009-10-27T12:50:43Z")

</div>

first. sorry about my english. i dont speak english very well.

please, someone help me…

i have an array with 2 colums.

ex: myfiles[1] = name of file  
myfiles[2] = text of file

i used marshal.dump in this array.

later… i try use marshal.load

ex:

line 1 - scbase = File.open(source, ‘rb’) { |f| Marshal.load f }  
line 2 - scbase.each do |script|  
line 3 - myfiles[1].gsub! ‘:’, ’ ’  
line 4 - path = folder + myfiles[1] + ‘.txt’  
line 5 - myfiles\_text = Zlib::Inflate.inflate(myfiles[2])  
line 6 - File.open(path, ‘wb’) {|file| file.write(myfiles\_text) }  
line 7 - end

if the second line of array contain a file name with non asciii char,  
the loop dont work.

when the line 4 is executed, the next loop is executed.

ex:

if the array contains 3 files:

1 = test  
2 = test \* number 2  
3 = another test

the line 2 is ignored and only 2 files is created.

but there is no error.

I thought to replace \* with \_ before the line 5.

but the loop is aborted before. in line 4.

any ideas?

please, help-me.
