Hello,
Post by BVMI've got a bunch of files from the past that were typed in using a
Magicnet font "NewtonCTT". Wondering if there is some way to cut and
paste into the Mongolian Unicode on Windows XP.
I don't know about Windows, but for example a Ruby script
as follows does what you need:
-[ctt2utf8.rb]------------------
#!/usr/local/bin/ruby
if (ARGV.length != 1) then
puts 'Please give output file name.'
exit
end
begin
file = File::open(ARGV[0], 'wb')
rescue
puts "Cannot write-open '#{ARGV[0]}', giving up."
exit 1
end
$stdin.each_byte { | b |
if (b >= 192 && b <= 255) # normal cyrillic letters
outcode = b - 192 + 0xd090
outcode = outcode + 0xc0 if (outcode > 0xd0bf)
file.putc(outcode / 0x100); file.putc(outcode % 0x100)
elsif (b == 170) # caps barred o
file.putc 0xd3; file.putc 0xa8
elsif (b == 186) # barred o
file.putc 0xd3; file.putc 0xa9
elsif (b == 175) # caps straight u
file.putc 0xd2; file.putc 0xae
elsif (b == 191) # straight u
file.putc 0xd2; file.putc 0xaf
else # other character
file.putc b
end
}
---------------------------------
I call it as: ./ctt2utf8.rb outfile.utf < infile.ctt
Of course, this is not cut+paste ;-) Can it be considered
easy anyway?
HTH,
Michael