Marshal error with nom ascii chars

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.

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