I am attempting to reproduce output in a particular format that appears to be very similar to two-byte packed UTF16. It seems every even byte is null, and I haven't seen any characters exceed one byte in size. It also doesn't have the two-byte endian-ness header (like Encode will produce.) I've tested many different ways to get this output, and have succeeded in all but one aspect.
My problem is with newlines. A proper newline (uses windows CR-LF) in this format is \x{0D}\x{00}\x{0A}\x{00}. I have failed to get perl to treat the \n as two distinct characters, and keep ending up with \x{0D}\x{0A}\x{00}. I have tried various things with split, s///, $/, Encode ("UTF-16", binmode, pack and unpack but have not hit upon the solution.
BTW, the file format is from a Samsung YH-820 mp3 player .plp file ( I'm autogenerating my playlists so that I don't need to install their "special" software.) If anyone knows of a filter already out there that I can use I'd be happy to check it out.
"One is enough. If you are acquainted with the principle, what do you care for the myriad instances and applications?"
- Henry David Thoreau, Walden
In reply to CR-LF Newlines as 2 distinct characters by blogical
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |