summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2012-05-21 13:45:25 +0000
committerNorbert Preining <preining@logic.at>2012-05-21 13:45:25 +0000
commitf2b72b72a62d72bb18807045105602794f7af7d4 (patch)
treeb44230cb996760808161bce1fb3360cb890bbc98 /Master/texmf-dist/scripts
parent018e147d8f39198dbfe1e7d383145187049254b9 (diff)
update convbkmk.rb from uptex web page
git-svn-id: svn://tug.org/texlive/trunk@26539 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-xMaster/texmf-dist/scripts/uptex/convbkmk.rb25
1 files changed, 15 insertions, 10 deletions
diff --git a/Master/texmf-dist/scripts/uptex/convbkmk.rb b/Master/texmf-dist/scripts/uptex/convbkmk.rb
index ab9e362df77..2794329384b 100755
--- a/Master/texmf-dist/scripts/uptex/convbkmk.rb
+++ b/Master/texmf-dist/scripts/uptex/convbkmk.rb
@@ -3,13 +3,13 @@
=begin
-convbkmk Ver.0.01
+convbkmk Ver.0.03
= License
convbkmk
-Copyright (c) 2009-2011 Takuji Tanaka
+Copyright (c) 2009-2012 Takuji Tanaka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -33,10 +33,14 @@ THE SOFTWARE.
2009.08.02 0.00 Initial version.
2011.05.02 0.01 Bug fix: BOM was not correct.
+2012.05.08 0.02 Bug fix: for a case of dvips with -z option and Ruby1.8.
+ Add conversion of /Creator and /Producer .
+2012.05.09 0.03 Suppress halfwidth -> fullwidth katakana conversion
+ and MIME decoding in Ruby1.8.
=end
-Version = "0.01"
+Version = "0.03"
require "optparse"
@@ -52,10 +56,10 @@ else
$RUBY_M17N = false
require "jcode" # for method each_char
- require "kconv"
+ require "nkf"
class String
def to_utf16be(enc)
- self.kconv(Kconv::UTF16, enc.kconv_enc)
+ NKF.nkf('-w16 -x -m0 '+enc.kconv_enc, self)
end
def ascii_only?
return self !~ /[\x80-\xFF]/n
@@ -64,7 +68,8 @@ else
tmp = "\"" + self + "\""
tmp.gsub!("\\(","\\\\\\(")
tmp.gsub!("\\)","\\\\\\)")
- tmp.gsub!("\n","\\n").gsub!("\r","\\r")
+ tmp.gsub!("\n","\\n")
+ tmp.gsub!("\r","\\r")
return tmp == self.inspect
end
def force_encoding(enc)
@@ -88,9 +93,9 @@ class TeXEncoding
@list = ['Shift_JIS', 'EUC-JP', 'UTF-8']
if !$RUBY_M17N
@kconv_enc = nil
- @kconv_list = {'Shift_JIS' => Kconv::SJIS,
- 'EUC-JP' => Kconv::EUC,
- 'UTF-8' => Kconv::UTF8}
+ @kconv_list = {'Shift_JIS' => '--sjis-input',
+ 'EUC-JP' => '--euc-input',
+ 'UTF-8' => '--utf8-input'}
end
end
@@ -290,7 +295,7 @@ def file_treatment(ifile, ofile, enc)
while l = ifile.gets do
line.force_encoding('ASCII-8BIT') if $RUBY_M17N
line += l
- if (line !~ %r!(/Author|/Title|/Subject|/Keywords)! )
+ if (line !~ %r!(/Title|/Author|/Keywords|/Subject|/Creator|/Producer)(\s+\(|$)! )
ofile.print line
line = ''
next