idata 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11570ba7b360f26bc26540fe1213fbbbf6a1c710
4
- data.tar.gz: fc475daab81c3971bafff657d1e4b40043dae3ac
3
+ metadata.gz: ee8c06be7ed48caab9e76b6e39544b812849ce3f
4
+ data.tar.gz: 396a15578b4a4fff1636926b3e71b36fca74f830
5
5
  SHA512:
6
- metadata.gz: 1e817cdd5df7131858677f27897206cd973306419537b3937c32d70b65b36b6c7115dd629a3a570ebb2870621b989aeea852bce725e286423feb6c5361ac9391
7
- data.tar.gz: 42723828b9b1b95fe14d8ef65185692e2e4982d9283f5e1b92954989376e36d1f8eedc3a464939a8a3ea467863bdb3e3b3fff309368ccfe9c71b63352a458114
6
+ metadata.gz: 8819c2ba1c7e628a287d2f0ed7e753c0e43f685a04446f0e94da9cf7bf7f36ac970391ea2c347eb45bd88e36be8111d53fb345788ea5746587a5565776eb4ea3
7
+ data.tar.gz: b0dfe2066c4802aca25639676b1719d8f95c5fcbcdc11a5992e9c1342b81b9b3f11aa367c2557afda79e8b9a8e36c49327dd9b6ee7ba0bd30b36d45d701f193c
@@ -1,4 +1,9 @@
1
1
  require 'csv'
2
+
3
+ # Set UTF-8
4
+ Encoding.default_internal = Encoding::UTF_8
5
+ Encoding.default_external = Encoding::UTF_8
6
+
2
7
  module Idata
3
8
  class Detector
4
9
  DEFAULT_DELIMITER = ","
@@ -7,7 +12,7 @@ module Idata
7
12
 
8
13
  def initialize(file)
9
14
  @file = file
10
- @sample = `head -n #{SAMPLE_SIZE} #{@file}`
15
+ @sample = `head -n #{SAMPLE_SIZE} #{@file}`.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
11
16
  @sample_lines = @sample.split(/[\r\n]+/)
12
17
  @candidates = COMMON_DELIMITERS.map { |delim|
13
18
  [delim, @sample.scan(delim).count]
data/lib/idata/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Idata
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idata
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nghi Pham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-22 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler