4 message_hash = Hash::new
6 open($*[0], "rb:UTF-16LE:UTF-8") do |f|
8 pattern = '\/\* Class = "(.*)"; .* = "(.*)"; ObjectID = "(.*)"; \*\/'
9 r = Regexp.new(pattern, Regexp::FIXEDENCODING)
12 value = "/* %s (%s) : <title:%s> (oid:%s) */" % [m[1], m[2], m[2], m[3]]
13 message_hash.store(key, value)
18 # Write Byte Order Mark
19 print "\uFEFF".encode("UTF-16LE")
21 message_hash.each { |key, comment|
22 output = "%s\n\"%s\" = \"%s\";\n\n" % [comment, key, key]
23 print output.encode("UTF-16LE")