Perl


Larry Wall really got it right..

Joining files…

Monday, February 28th, 2005

Today comes more stuff from my work. This time I had to join some files and build some info about this joining to prepare resources for a cellphone doja game. So I wrote a simple little perl script to be used as part of the same project’s build process.. It packs (without compressing) graphics and sound files into an archive and writes code (#defines with offsets and file sizes) to enable the application to use them.

In case (quite unlikely, I must admit) that you are interested by this script, here it is.

Read the rest of this entry »

Removing Unicode BOMs from text files

Friday, February 18th, 2005

In order for text editors to accurately detect Unicode text encodings in files, there exists a multibyte signature called BOM which, located at the very beginning of a file, tells the application which UTF the text is encoded in.

Now, some editors place this signature automatically, and it is quite possible that it is not desirable to have it placed, say, for example, in HTML or PHP files. If the webserver serving those files is not able to detect and remove those bytes, they will get displayed at the beginning of the page, maybe causing errors to happen, for example if they get output before session starting in PHP.

Read the rest of this entry »