Hi Chris, On Sat, 8 Nov 2014 18:23:03 +0200 Chris Knipe <sav...@savage.za.org> wrote:
> Hi, > > Yes, sorry. This is an entire mess :-( > > I get the content correctly (I have confirmed that numerous times > through various different ways), but printing the strings out via > STDOUT messes things up. > > Sorry for the attachment and all of that (I'm desperate, my entire > company is currently offline due to this and I've been at it now for > close to 24 hours), but the attached is a sample of the data I receive > via a socket, and (to test) I have written it to disk: > > open(my $out, '>:raw', $filename) or die "Unable to open: $!"; > binmode($out); > print $out $Body; > close($out); It's hard to discern from your attachments what's going on. I got two files - c108fca64135d6162654d1625cbbc063-D and test.bin that the UNIX "file" command both tell me are "data". I don't see any self-contained, reproducing, code anywhere. Make sure all these hold for it: * http://perl-begin.org/tutorials/bad-elements/ * http://www.catb.org/~esr/faqs/smart-questions.html * http://shadow.cat/blog/matt-s-trout/show-us-the-whole-code/ Perhaps you'd like to attach a .zip file or whatever with everything I need? Regards, Shlomi Fish > > That works. I've used tools to verify the CRC of the yEnc, and the > CRC matches fine. So I do receive the data correctly but I am > apparently not sending it correct from perl back out to the client via > a print > > When I print this out via STDOUT however (perl script that runs under > xinetd) the data (output) is messed up completely. I've tried playing > with Encode (which breaks other things), Encoding, binmode... I'm at > my wits end. I change something and it works, and then almost by > magic, a few hours later (or days) it just stops working again... > > At this stage I am almost at the point where I'm prepared to have > someone look at the code and fix it for me ($$$), this is really > urgent and hurting us badly as a company. I've been at this now for > close to 24 hours so my eyes and brains may be overlooking things too > I suppose. > > If we say, $Output = one of the attached files, > > Surely, > > use utf; > binmode (STDOUT) or binmode(STDOUT, ':utf8') or binmode(STDOUT, > ':encoding(utf8)' (can't remember the exact encoding syntax right now) > print STDOUT $Output; > > Should work... But the data is simply not correct. > > It acts as a proxy, so I receive a request, I collect the data from > the remote server (capture the packets on the wire with tcpdump), I > send the data to the client through perl connected to STDOUT (and > capture it on the wire with tcpdump). > > The entire encoding of the data received from the first tcpdump to the > parent server, and the tcpdump to the client is WAY different... > > > > > > > On Sat, Nov 8, 2014 at 5:52 PM, Shlomi Fish <shlo...@shlomifish.org> wrote: > > Hi Chris, > > > > On Sat, 8 Nov 2014 11:53:44 +0200 > > Chris Knipe <sav...@savage.za.org> wrote: > > > >> Hi All, > >> > >> I'm reading loads, and loads of very confusing and contradicting > >> information about UTF8 in Perl. A lot of posts are also (rightfully IMHO) > >> stating that UTF8 is an absolute nightmare in Perl. > >> > >> Can someone shed some light as to what is going on here please: > >> > > > > Can you provide a self-contained, reproducing, example, with all best > > practices? > > > > See http://shadow.cat/blog/matt-s-trout/show-us-the-whole-code/ . > > > > Otherwise - your example is hard to reproduce. > > > > Regards, > > > > Shlomi Fish > > > > -- > > ----------------------------------------------------------------- > > Shlomi Fish http://www.shlomifish.org/ > > Optimising Code for Speed - http://shlom.in/optimise > > > > English spelling aims to be consistent. Publicly and methodically. > > > > Please reply to list if it's a mailing list post - http://shlom.in/reply . > > > > -- > > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > > For additional commands, e-mail: beginners-h...@perl.org > > http://learn.perl.org/ > > > > > > > -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ What Makes Software Apps High Quality - http://shlom.in/sw-quality In the Technion, there are many ways to get from one place to the other, but they are all the same length. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/