Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: zlib compression of numeric values

by mbethke (Hermit)
on Jul 17, 2012 at 05:30 UTC ( #982134=note: print w/replies, xml ) Need Help??


in reply to zlib compression of numeric values

A couple of questions so I understand the problem:

  • Are you running out of disk/flash space or RAM? If it's the former, you could compress the entire files and when the required language has been determined, decompress one of them for use (what about a copmpressing file system?). But it sounds more like it's the latter so you want to compress individual strings.
  • Are you compiling the .po files into .mo to use them?
  • Why are you trying to compress single numbers? They won't compress anyway. If you really have to shove everything through zlib for some reason, you could use pack('I', $num) to turn it into a string, but don't do that. Maybe it's Pascal strings of length+string instead of lengthstring+'\0' you want to compress as a whole?
  • Why is there a terminating NUL that you can't include? C usually wants that, maybe the i18n library doesn't?

Edit: fixed Pascal string description

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982134]
help
Chatterbox?
[erix]: record separator
[Cosmic37]: Permissions are interesting earthlings. Did nature determine who gives permission and who asks permission. Who was the first to get permission? Are you not related to them as one big earthling family?
[karlgoethebier]: Cojones! We need cojones!
[karlgoethebier]: Ouch! Permissions! We need permissions!
[BarApp]: I can not use modules. I gain temporary access and still can not use modules.
[Cosmic37]: ta erix - this szabo geezer is pretty cool methinks and he writes about undef but I cannot see instructions for redefining the record separator after having undefined it

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2017-06-29 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (672 votes). Check out past polls.