This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Artoria2e5
Recipients Artoria2e5, ezio.melotti, vstinner
Date 2016-10-09.21:43:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476049410.4.0.548041889071.issue28343@psf.upfronthosting.co.za>
In-reply-to
Content
The "join the web people" solution should look like this:

$ diff -Naurp a/_codecs_cn.c b/_codecs_cn.c
--- a/_codecs_cn.c    2016-10-09 14:24:04.675111500 -0700
+++ b/_codecs_cn.c    2016-10-09 14:27:06.600961500 -0700
@@ -128,6 +128,12 @@ ENCODER(gbk)
             continue;
         }

+        if (c == 0x20AC) { /* cp936, or web GBK */
+            WRITEBYTE1((unsigned char)0x80);
+            NEXT(1, 1);
+            continue;
+        }
+
         if (c > 0xFFFF)
             return 1;

@@ -159,6 +165,12 @@ DECODER(gbk)
             NEXT_IN(1);
             continue;
         }
+
+        if (c == 0x80) { /* cp936, or web GBK */
+            OUTCHAR(0x20AC);
+            NEXT_IN(1);
+            continue;
+        }

         REQUIRE_INBUF(2);

It should be mostly safe as this character is not previously defined in Python's GBK implementation.
History
Date User Action Args
2016-10-09 21:43:30Artoria2e5setrecipients: + Artoria2e5, vstinner, ezio.melotti
2016-10-09 21:43:30Artoria2e5setmessageid: <1476049410.4.0.548041889071.issue28343@psf.upfronthosting.co.za>
2016-10-09 21:43:30Artoria2e5linkissue28343 messages
2016-10-09 21:43:30Artoria2e5create