Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: What is the proper way to read non-ANSI data

by BrowserUk (Patriarch)
on Sep 13, 2015 at 05:09 UTC ( [id://1141801]=note: print w/replies, xml ) Need Help??


in reply to What is the proper way to read non-ANSI data

If I set binmode ":encoding(UTF-8)" on the pipe, data containing the character '–' is read correctly, but the character '·' is not. If I omit the binmode call, the '·' character is read correctly,

Then the output being produced by dumptorrent.exe must not be encoded as either ascii or utf8.

Typically unicode on windows system is cp1250; so try that.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
  • Comment on Re: What is the proper way to read non-ANSI data

Replies are listed 'Best First'.
Re^2: What is the proper way to read non-ANSI data
by freonpsandoz (Beadle) on Sep 13, 2015 at 06:42 UTC
    cp1250 seems to do the same thing as omitting the binmode call: '·' is read correctly, but '–' isn't.

      Then you'll need to work out what encoding the program is outputting. (That's the problem with Unicode; it doesn't self identify.)

      Try posting a few lines of the output from running the following command:

      dumptorrent.exe the.file | perl -nle"print; print unpack 'H*', $_"

      Perhaps the output will allow someone to recognise the encoding being used.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.
      I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!

        Here are a few lines containing '–' :

        01. Chumbawamba – Tubthumping.flac 3334150 +0 (31.8M) 2020202020202020202020202020202030312e204368756d626177616d626120e28093 +205475627468756d70696e672e666c616320202020202020202020202020333333343 +1353030202833312e384d29 02. Chumbawamba – Amnesia.flac 2967589 +6 (28.3M) 2020202020202020202020202020202030322e204368756d626177616d626120e28093 +20416d6e657369612e666c61632020202020202020202020202020202020323936373 +5383936202832382e334d29 03. Chumbawamba – Drip, Drip, Drip.flac 3439731 +9 (32.8M) 2020202020202020202020202020202030332e204368756d626177616d626120e28093 +20447269702c20447269702c20447269702e666c61632020202020202020333433393 +7333139202833322e384d29

        Here are a few lines containing '·' :

        Love and Rockets - Earth·Sun·Moon (1987) [FLAC] (Remas +tered 2002)/01 - Love And Rockets - Mirror People.flac + 2 +9252517 (27.9M) 202020202020202020202020202020204c6f766520616e6420526f636b657473202d20 +4561727468b753756eb74d6f6f6e20283139383729205b464c41435d202852656d617 +374657265642032303032292f3031202d204c6f766520416e6420526f636b65747320 +2d204d6972726f722050656f706c652e666c616320202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020 +202020202020202020202020202020202020202020202020202020202020202020203 +239323532353137202832372e394d29 Love and Rockets - Earth·Sun·Moon (1987) [FLAC] (Remas +tered 2002)/02 - Love And Rockets - The Light.flac + 2 +9669003 (28.3M) 202020202020202020202020202020204c6f766520616e6420526f636b657473202d20 +4561727468b753756eb74d6f6f6e20283139383729205b464c41435d202852656d617 +374657265642032303032292f3032202d204c6f766520416e6420526f636b65747320 +2d20546865204c696768742e666c61632020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020 +202020202020202020202020202020202020202020202020202020202020202020203 +239363639303033202832382e334d29

        Thanks in advance for any help you or anyone else can provide.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1141801]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-26 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found