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