rjb 1.6.8 → 1.6.9

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
  SHA256:
3
- metadata.gz: c844ae35b7db5e279feb4088495040f16f520173a65c096b564a88a2816faba6
4
- data.tar.gz: 842e428865248d83b1a49d61ffa5b654586ecb80cf566e78b9b6ff4c0a7a5dbf
3
+ metadata.gz: db68bd4fe5b0ad8ab33ded261ddfbddac69c2f1713b3be5ccec7c19bf6d504ef
4
+ data.tar.gz: 05cfef71f471a7e181964971cc9efdbf14a6be594957c8f7f2cc79d66abcb634
5
5
  SHA512:
6
- metadata.gz: 115259efb72d586e6cea9d2b12ccbd90c5b18bc531f60753b4348463f768d3721ff17af0f3a3979b5830e98c023a7d02818edc125b2a6779816440b8fc6bc297
7
- data.tar.gz: 93e80bc33b9f8ea9f658a8566e9b4e72d03a01eca89f283323180ec4d146a625b5ca751e1c20fc93ffb8864d162a5370b2e0f2513a10f569729131bbbd60f4ac
6
+ metadata.gz: d03e67bbe85d5d21ad9368d9956d48e802d2948260f9df551ebf9c3ea5c98753400dfe0446bd0a6fa5711e1f23ce2ed3144e2529c88a6507d8d5ca01fbb91d79
7
+ data.tar.gz: 1811c379afd0cfae646b3fd055399d706e3ee94270c9585f34b0ddbe4c7225694480fce0b390e9762e54292c1d6e8d9073a7deb71e6561b3923b46f79585109b
data/ChangeLog CHANGED
@@ -1,3 +1,10 @@
1
+ Thu Nov 9 2023 arton
2
+ * ext/rjb.c
3
+ RJB_VERSION -> 1.6.9
4
+ * ext/riconv.c
5
+ fix CESU-8 check
6
+ * test/est.rb
7
+ add test_jav_hangul_syllable for checking CESU-8 bug (char start with 0xed)
1
8
  Thu Sep 28 2023 chaddow
2
9
  #93 fake allocation framework to remove T_DATA warning
3
10
  * ext/rjb.c
data/ext/extconf.h CHANGED
@@ -4,5 +4,5 @@
4
4
  #define HAVE_NL_LANGINFO 1
5
5
  #define HAVE_SETLOCALE 1
6
6
  #define HAVE_GETENV 1
7
- #define RJB_RUBY_VERSION_CODE 278
7
+ #define RJB_RUBY_VERSION_CODE 322
8
8
  #endif
data/ext/riconv.c CHANGED
@@ -14,7 +14,6 @@
14
14
  *
15
15
  * $Id: riconv.c 117 2010-06-04 12:16:25Z arton $
16
16
  */
17
-
18
17
  #include "ruby.h"
19
18
  #include "extconf.h"
20
19
 
@@ -196,12 +195,15 @@ static int contains_auxchar(const unsigned char* p)
196
195
  {
197
196
  while (*p)
198
197
  {
199
- if (*p == 0xed)
198
+ if (*p == 0xed && *(p + 1) && *(p + 1))
200
199
  {
201
200
  #if defined(DEBUG)
202
- printf("find %02x %02x %02x %02x %02x %02x\n", *p, *(p + 1), *(p + 2), *(p + 3), *(p + 4), *(p + 5));
201
+ printf("find %02x %02x %02x %02x %02x %02x\n", *p, *(p + 1), *(p + 2), *(p + 3), *(p + 4), *(p + 5));
203
202
  #endif
204
- return 1;
203
+ if ((*(p + 1) & 0xa0) == 0xa0 && (*(p + 2) & 0xb0) == 0xb0)
204
+ {
205
+ return 1;
206
+ }
205
207
  }
206
208
  switch (*p & 0xe0)
207
209
  {
data/ext/rjb.c CHANGED
@@ -14,7 +14,7 @@
14
14
  *
15
15
  */
16
16
 
17
- #define RJB_VERSION "1.6.8"
17
+ #define RJB_VERSION "1.6.9"
18
18
 
19
19
  #include "ruby.h"
20
20
  #include "extconf.h"
data/test/test.rb CHANGED
@@ -960,10 +960,20 @@ class TestRjb < Test::Unit::TestCase
960
960
  end
961
961
 
962
962
  def test_java_utf8
963
- y = @jString.new('𠮷野家')
963
+ y = @jString.new('𠮷野家') # with surrogate pair
964
964
  assert_equal '𠮷野家', y.toString
965
965
  end
966
966
 
967
+ def test_java_hangul_syllable
968
+ # 토 \uD1A => ED 86 A0 (utf-8)
969
+ test_string = "토" # simple unicode char (not surrogate pair)
970
+ y = @jString.new_with_sig('Ljava.lang.String;', test_string)
971
+ assert_equal(test_string, y.toString)
972
+ test_string = "토토" # simple unicode char (not surrogate pair)
973
+ y = @jString.new_with_sig('Ljava.lang.String;', test_string)
974
+ assert_equal(test_string, y.toString)
975
+ end
976
+
967
977
  def test_respond_to
968
978
  str = @jString.new('blabla')
969
979
  assert str.respond_to? :substring
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.8
4
+ version: 1.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - arton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-28 00:00:00.000000000 Z
11
+ date: 2023-11-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'RJB is a bridge program that connect between Ruby and Java with Java
14
14
  Native Interface.