I was unable to add BOM to a UTF-8 text that is exported from Ruby script.
The official way of treating UTF-8 and BOM looks still confused a little bit.
I got quite funny when I found a way to declare a dummy two-dimension array in Ruby:
2darray = ["dummy" ["dummy"]]
Very funny, but does work. I believe this is unofficial.
Instead, the following does not work: