Skip to content

Commit 290a0b6

Browse files
author
Kendall Buchanan
committed
Moved to String#encode instead of Iconv
1 parent 1783793 commit 290a0b6

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.gem
22
.DS_Store
3+
*.swp

lib/docsplit/info_extractor.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'iconv'
2-
31
module Docsplit
42

53
# Delegates to **pdfinfo** in order to extract information about a PDF file.
@@ -21,7 +19,7 @@ class InfoExtractor
2119
def extract(key, pdfs, opts)
2220
pdf = [pdfs].flatten.first
2321
cmd = "pdfinfo #{ESCAPE[pdf]} 2>&1"
24-
result = Iconv.conv('ASCII//IGNORE', 'UTF8', `#{cmd}`.chomp)
22+
result = `#{cmd}`.encode(Encoding::ISO_8859_1, :undef => :replace)
2523
raise ExtractionFailed, result if $? != 0
2624
match = result.match(MATCHERS[key])
2725
answer = match && match[1]

0 commit comments

Comments
 (0)