pg_data_encoder 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,14 @@
1
1
  class TempBuffer
2
2
  def initialize
3
- @st = ""
3
+ @st = "".force_encoding("ASCII-8BIT")
4
4
  end
5
5
  def size
6
6
  @st.bytesize
7
7
  end
8
8
 
9
9
  def write(st)
10
- @st << st
10
+
11
+ @st << st.force_encoding("ASCII-8BIT")
11
12
  end
12
13
  def rewind
13
14
 
@@ -1,3 +1,3 @@
1
1
  module PgDataEncoder
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
Binary file
@@ -32,6 +32,7 @@ describe "generating data" do
32
32
  encoder = PgDataEncoder::EncodeForCopy.new(:use_tempfile => true)
33
33
  encoder.add [{test: "Ekström"}]
34
34
  encoder.add [{test: "Dueñas"}]
35
+ encoder.add [{"account_first_name"=>"asdfasdf asñas", "testtesttesttesttesttestest"=>"" , "aasdfasdfasdfasdfasdfasdfasdfasdfasfasfasdfs"=>""}] #needed to verify encoding issue
35
36
  encoder.close
36
37
  io = encoder.get_io
37
38
  existing_data = filedata("hstore_utf8.dat")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_data_encoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: