CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
How do i convert binary to ascii?

 



technovision
New User

Feb 16, 2003, 6:34 PM

Post #1 of 5 (1198 views)
How do i convert binary to ascii? Can't Post

Can anyone provide a perl algorithm for converting between binary to ascii. CPAN didn't have much.


thodi
stranger

Feb 17, 2003, 12:03 AM

Post #2 of 5 (1193 views)
Re: [technovision] How do i convert binary to ascii? [In reply to] Can't Post

Could you be alittle more specific with what you need? What are you doing, what do you want the result to be? Do you want nonprinting characters to be replaced?


Paul
Enthusiast

Feb 17, 2003, 3:05 AM

Post #3 of 5 (1190 views)
Re: [technovision] How do i convert binary to ascii? [In reply to] Can't Post

Read this:

http://www.experts-exchange.com/Programming/Programming_Languages/Perl/Q_20254298.html


technovision
New User

Feb 17, 2003, 10:33 AM

Post #4 of 5 (1185 views)
Re: [Paul] How do i convert binary to ascii? [In reply to] Can't Post

Yes, I read that. It seemed like an interesting disussion but I didn't see a clear solution drawn. What I am looking for is a blueprint for converting binary to ascii and storing or printing the result in ascii. I am assumming that the format of the binary data is given and could be letters, numbers or special characters.

For example if the number 2500 is stored in binary, what algorithm do i use to convert it in ascii. Similarly, if the string "Two Thousand Five Houndred" is stored in binary, what algorithm do i use to convert it as well. I'm not so much concerned with special characters necessarily.

Thank you and to all.


davorg
Thaumaturge / Moderator

Feb 18, 2003, 1:53 AM

Post #5 of 5 (1181 views)
Re: [technovision] How do i convert binary to ascii? [In reply to] Can't Post

I think you need to take a look at pack and unpack.

And there's also perldoc perlpacktut which is a tutorial on using them.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives