[Pkg-javascript-commits] [node-iconv] 01/02: Enhance patch to get the same behavior as upstream's libiconv

Jérémy Lal kapouer at moszumanska.debian.org
Mon Jun 16 23:25:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

kapouer pushed a commit to branch master
in repository node-iconv.

commit a56b3e62b4bfdde6c9d77a34f8e35140b80dcb67
Author: Jérémy Lal <kapouer at melix.org>
Date:   Tue Jun 17 01:10:20 2014 +0200

    Enhance patch to get the same behavior as upstream's libiconv
---
 debian/patches/use-glibc-iconv.patch | 27 ++++++++-------------------
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/debian/patches/use-glibc-iconv.patch b/debian/patches/use-glibc-iconv.patch
index d7dc018..8eab90a 100644
--- a/debian/patches/use-glibc-iconv.patch
+++ b/debian/patches/use-glibc-iconv.patch
@@ -1,10 +1,14 @@
 Description: use system iconv from glibc
  1) do not build bundled iconv
- 2) work around eglibc libiconv implementation
- 3) change some tests expectations to match what happens with eglibc
+ 2) work around eglibc libiconv implementation, that is:
+  * do not throw when //ignore is on
+  * set C.UTF-8 locale to get previsible //translit behavior;
+    this is possible because C locale is portable (setlocale(3)),
+    and transliteration need UTF-8 code-set to work the same as
+    upstream's libiconv tested behavior.
 Forwarded: not-needed
 Author: Jérémy Lal <kapouer at melix.org>
-Last-Update: 2014-06-14
+Last-Update: 2014-06-16
 --- a/binding.gyp
 +++ b/binding.gyp
 @@ -2,7 +2,6 @@
@@ -80,7 +84,7 @@ Last-Update: 2014-06-14
  
    static void Initialize(Handle<Object> obj)
    {
-+    setlocale(LC_ALL, "");
++    setlocale(LC_CTYPE,"C.UTF-8");
      NanScope();
      Local<ObjectTemplate> t = ObjectTemplate::New();
      t->SetInternalFieldCount(1);
@@ -123,18 +127,3 @@ Last-Update: 2014-06-14
        }
        else if (errno === EINVAL) {
          if (context === null || input === FLUSH) {
---- a/test/test-basic.js
-+++ b/test/test-basic.js
-@@ -108,10 +108,10 @@
- assert.equal(iconv.convert('ça va').toString(), 'ca va');
- 
- iconv = new Iconv('utf-8', 'ascii//translit');
--assert.throws(function() { iconv.convert('ça va が'); }); // untranslatable
-+assert.equal(iconv.convert('ça va が').toString(), 'ca va ?');
- 
- iconv = new Iconv('utf-8', 'ascii//translit//ignore');
--assert.equal(iconv.convert('ça va が').toString(), 'ca va ');
-+assert.equal(iconv.convert('ça va が').toString(), 'ca va ?');
- 
- iconv = Iconv('utf-8', 'iso-8859-1');
- assert.equal(iconv.convert('b2s=', 'base64').toString(), 'ok');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-iconv.git



More information about the Pkg-javascript-commits mailing list