in reply to What is this warning? 'Character in ''c'' format wrapped at ...'
I've not seen it before, but it appears to be related to how ASCII characters are handled with pack. From this bug report, it mentions that error occurs when dealing with non-ASCII characters. The fix was to change from pack "c"... to pack "C".... The pack documentation also hints at this.
The source code that generates this tends to suggest that you may just need to switch your template (of course, that really depends upon what you're trying to do with pack):
case 'C': case 'c': while (len-- > 0) { fromstr = NEXTFROM; switch (datumtype) { case 'C': aint = SvIV(fromstr); if ((aint < 0 || aint > 255) && ckWARN(WARN_PACK)) Perl_warner(aTHX_ WARN_PACK, "Character in \"C\" format wrapped"); achar = aint & 255; sv_catpvn(cat, &achar, sizeof(char)); break; case 'c': aint = SvIV(fromstr); if ((aint < -128 || aint > 127) && ckWARN(WARN_PACK)) Perl_warner(aTHX_ WARN_PACK, "Character in \"c\" format wrapped"); achar = aint & 255; sv_catpvn(cat, &achar, sizeof(char)); break; } } break;
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: What is this warning? 'Character in ''c'' format wrapped at ...'
by halley (Prior) on May 15, 2003 at 20:23 UTC | |
|
Re: Re: What is this warning? 'Character in ''c'' format wrapped at ...'
by John M. Dlugosz (Monsignor) on May 16, 2003 at 15:02 UTC |