Thou shalt not assume %x works for UVs.
Jarkko Hietaniemi [Wed, 24 Apr 2002 17:03:22 +0000 (17:03 +0000)]
p4raw-id: //depot/perl@16132

ext/Encode/Encode.xs

index 53716b8..1476456 100644 (file)
@@ -141,7 +141,7 @@ encode_method(pTHX_ encode_t * enc, encpage_t * dir, SV * src,
                                goto ENCODE_SET_SRC;
                    }else if (check & ENCODE_PERLQQ){
                        SV* perlqq = 
-                           sv_2mortal(newSVpvf("\\x{%04x}", ch));
+                           sv_2mortal(newSVpvf("\\x{%04"UVxf"}", ch));
                        sdone += slen + clen;
                        ddone += dlen + SvCUR(perlqq);
                        sv_catsv(dst, perlqq);