Message278393
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. |
|
Date |
User |
Action |
Args |
2016-10-09 21:43:30 | Artoria2e5 | set | recipients:
+ Artoria2e5, vstinner, ezio.melotti |
2016-10-09 21:43:30 | Artoria2e5 | set | messageid: <1476049410.4.0.548041889071.issue28343@psf.upfronthosting.co.za> |
2016-10-09 21:43:30 | Artoria2e5 | link | issue28343 messages |
2016-10-09 21:43:30 | Artoria2e5 | create | |
|