--- Nicholas Clark <[EMAIL PROTECTED]> wrote:

> On Tue, Jul 26, 2005 at 07:55:21AM -0700, rajarshi
> das wrote:
> 
> > The change is in the fn Perl_utf8n_to_uvuni :
> > -------------------
> > .....
> > ....
> > 
> > #define UTF8_WARN_LONG                           8
> > #define UTF8_WARN_FFFF                           9
> /*
> > Also FFFE. */
> > 
> >     if (curlen == 0 &&
> >         !(flags & UTF8_ALLOW_EMPTY)) {
> >         warning = UTF8_WARN_EMPTY;
> >         goto malformed;
> >     }
> > #ifdef EBCDIC   /* the change */
> >       uv = NATIVE_TO_UTF(uv);
> > #endif          /* the change ends here */
> > 
> >     if (UTF8_IS_INVARIANT(uv)) {
> >         if (retlen)
> >             *retlen = 1;
> >         return (UV) (NATIVE_TO_UTF(*s));
> >     }
> > ....
> > ...
> 
> 
> A context or unified diff with the original source
> would have been clearer,
> at least in part because most people on the list are
> used to it.
Here's the diff :
--- utf8.c      2004-11-17 18:22:09.000000000 +0530
+++ utf8.c.1    2005-07-26 20:50:11.000000000 +0530
@@ -363,7 +363,9 @@ Perl_utf8n_to_uvuni(pTHX_ U8 *s,
STRLEN
        warning = UTF8_WARN_EMPTY;
        goto malformed;
     }
-
+#ifdef EBCDIC
+    uv = NATIVE_TO_UTF(uv);
+#endif
     if (UTF8_IS_INVARIANT(uv)) {
        if (retlen)
            *retlen = 1;


> 
> I don't understand this code, so I don't know why. I
> think that part of the
> reason that you're getting few to no responses to
> your questions is because
> few people understand this code in the first place,
> and none of them
> understand how it interacts with EBCDIC.
> 
> 
> The only thing I can think of is that I notice that
> further down that function
> there is:
> 
> #ifdef EBCDIC
>     uv = NATIVE_TO_UTF(uv);
> #else
>     if ((uv == 0xfe || uv == 0xff) &&
>       !(flags & UTF8_ALLOW_FE_FF)) {
>       warning = UTF8_WARN_FE_FF;
>       goto malformed;
>     }
> #endif
> 
> Is that second call to NATIVE_TO_UTF still present
> in your modified code?
Yes, the second call to NATIVE_TO_UTF is still present
in the modified code. Typically, one wouldnt want to
do a NATIVE_TO_UTF(NATIVE_TO_UTF(uv)) which is what I
am doing due to the second call. But does that make a
difference to miniperl ? 

> 
> Nicholas Clark
> 
Thanks,
Rajarshi.


                
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

Reply via email to