1

I am accustomed to dealing with top level data using SQL (I used some Fortran IV and COBOL back in the day), and am trying to re-train myself in Python. I have a problem reading a file which I think is uuencoded. Could you confirm this, or suggest what it may be, and what the best way to read it in Python would be? Here it is:

4¬xUÕÀÀBAyJ¾ ‚Å
wim
  • 338,267
  • 99
  • 616
  • 750
  • Dous [uu](https://docs.python.org/3/library/uu.html#module-uu) do what you need? – dawg Sep 02 '17 at 00:18
  • It's not uuencoded because it contains non-ascii characters. Is this the whole file? What encoding is your editor/console set to (I'm guessing Windows-1252)? – trent Sep 02 '17 at 00:23
  • This is actually a sample of 21 bytes of data that makes up a record that I want to record, decode to Hex and/or Int/Float date. – David G. Brooks Sep 02 '17 at 00:24
  • It looks to me like 15 bytes (not 21) erroneously decoded as Windows-1252. But it might be almost anything. I don't think this question is answerable; you need to know *something* about how the data was *en*coded in order to *de*code it. – trent Sep 02 '17 at 00:46
  • 1
    Related: [Unbaking mojibake](https://stackoverflow.com/q/24140497/674039) – wim Sep 02 '17 at 00:48
  • 1
    Also probably worth linking: [The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)](https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/) – trent Sep 02 '17 at 00:56
  • This is actually the record - 4¬xUÕÀÀBAyJ¾ ‚Å – David G. Brooks Sep 02 '17 at 01:01
  • Not all the characters are copy and pasting from Notepad++ that I opened the file with. There are some box shaped characters - that have like 00 at the top and another pair of number in the lower part of the box - they don't show when I paste. Can I upload a sample of the file here? Or an image? – David G. Brooks Sep 02 '17 at 01:07
  • I just uploaded a sample of this to my web site ... http://brohavwx.com/20170820-TestRecord.ldc – David G. Brooks Sep 02 '17 at 01:12
  • Looks more like Unicode now that I have researched a bit more or some variant. – David G. Brooks Sep 02 '17 at 01:16

0 Answers0