U
Une bévue
i have a small script building an xml string and, afterwards, i need to
convert the string.
basically i do :
xml=""
album_list.each do |k,l|
xml=xml+"<name first=\"#{l[0]}\" last=\"#{l[1]}\" company=\"#{l[2]}\"
organization=\"#{l[3]}\"/>\n"
end
tmpFile.puts xml
system("iconv -c -s -f MACROMAN -t UTF-8 #{tmpName} >
#{xmlDir}/#{xmlName}")
and the resulting conversion lacks of one half a line to 26 lines,
depending the number of lines (some how randomly))
if after having done that, i launch iconv from command line by :
iconv -c -s -f MACROMAN -t UTF-8 /tmp/AddressBook-MACROMAN.xml >
AddressBook.xml
("same" command as system("..."))
i get all the 156 lines ???
does than means system("iconv -c ...") is started within the ruby script
before the end of "tmpFile.puts xml" in which case i'd have to sync
writing by puts and reading by iconv ?
if this is true, how to do that ?
convert the string.
basically i do :
xml=""
album_list.each do |k,l|
xml=xml+"<name first=\"#{l[0]}\" last=\"#{l[1]}\" company=\"#{l[2]}\"
organization=\"#{l[3]}\"/>\n"
end
tmpFile.puts xml
system("iconv -c -s -f MACROMAN -t UTF-8 #{tmpName} >
#{xmlDir}/#{xmlName}")
and the resulting conversion lacks of one half a line to 26 lines,
depending the number of lines (some how randomly))
if after having done that, i launch iconv from command line by :
iconv -c -s -f MACROMAN -t UTF-8 /tmp/AddressBook-MACROMAN.xml >
AddressBook.xml
("same" command as system("..."))
i get all the 156 lines ???
does than means system("iconv -c ...") is started within the ruby script
before the end of "tmpFile.puts xml" in which case i'd have to sync
writing by puts and reading by iconv ?
if this is true, how to do that ?