Upgrade to Encode 0.99, from Dan Kogai.
[p5sagit/p5-mst-13.2.git] / ext / Encode / Encode.xs
index 9bd8a4c..05ff836 100644 (file)
@@ -8,7 +8,7 @@
 /* #include "8859.h" */
 /* #include "EBCDIC.h" */
 /* #include "Symbols.h" */
-#include "defcodes.h"
+#include "def_t.h"
 
 #define UNIMPLEMENTED(x,y) y x (SV *sv, char *encoding) {dTHX;   \
                          Perl_croak(aTHX_ "panic_unimplemented"); \
@@ -576,7 +576,15 @@ encode_method(pTHX_ encode_t * enc, encpage_t * dir, SV * src,
        if (check) {
            sdone = SvCUR(src) - (slen+sdone);
            if (sdone) {
+#if 1
+               /* FIXME: A Move() is dangerous - PV could be mmap'ed readonly
+                  SvOOK would be ideal - but sv_backoff does not understand SvLEN == 0
+                  type SVs and sv_clear() calls it ...
+                */
+                sv_setpvn(src, (char*)s+slen, sdone);
+#else
                Move(s + slen, SvPVX(src), sdone , U8);
+#endif
            }
            SvCUR_set(src, sdone);
        }
@@ -785,5 +793,5 @@ BOOT:
 /* #include "8859_def.h" */
 /* #include "EBCDIC_def.h" */
 /* #include "Symbols_def.h" */
-#include "defcodes_def.h"
+#include "def_t_def.h"
 }