Re: python's YENC.DECODE -> weird output

Discussion in 'Python' started by John Machin, Jul 16, 2008.

  1. John Machin

    John Machin Guest

    On Jul 16, 11:33 pm, John Savage <> wrote:
    > I save posts from a midi music newsgroup, some are encoded with
    > yenc encoding. This gave me an opportunity to try out the decoders
    > in Python. The UU decoder works okay, but my YENC effort gives
    > results unexpected:
    >
    > import yenc, sys
    >
    > fd1=open(sys.argv[1],'r')
    > #yenc.encode(sys.argv[1],"outfile.yenc",bytes=0)
    > yenc.decode(sys.argv[1],"outfile.mid",bytes=0,crc_in='')
    >
    > I confirmed that yenc.decode exactly reverses yenc.encode, BUT the
    > encoding itself seems to differ from the USENET standard. That is,
    > when I decode USENET files the result isn't a valid music file.
    > (I did try both with and w/o the headers.)
    >
    > Maybe it uses a different character set? I can't quite put my
    > finger on what might be happening. What I can say is that the
    > yenc coding from the newsgroup article, when viewed with Linux
    > 'more', displays roughly 10% of its characters as a question mark,
    > whereas when I give Python's yenc.encode a binary music file and
    > view its output using 'more', it displays about 90% of the output
    > as a question mark.
    >
    > Any ideas?


    1. It isn't "Python's yenc". Consider directing your question to
    whoever (if anyone) is maintaining whichever third-party module you
    are talking about.

    2. Consider using a tool that will display what is going on in
    characters and hex e.g. http://linux.about.com/library/cmd/blcmdl1_hexdump.htm
     
    John Machin, Jul 16, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Freddie
    Replies:
    3
    Views:
    439
    Freddie
    Aug 5, 2003
  2. Kairo Matthias

    yEnc

    Kairo Matthias, Aug 15, 2006, in forum: Python
    Replies:
    2
    Views:
    543
    Dennis Lee Bieber
    Aug 16, 2006
  3. fais
    Replies:
    0
    Views:
    296
  4. yEnc decoding

    , Aug 31, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    94
  5. yEnc decoding

    , Sep 9, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    114
    Tad McClellan
    Sep 9, 2003
Loading...

Share This Page