bin2c was distributed with lua until 5.1. I use bin2c because I need to embedded lua scripts into the shared C libraries. Is there a better way of doing this as bin2c was dropped from the lua distribution.
A slightly fancier version is here that will optionally preserve text
line formatting (for use with version control systems) or dump binary
files in an 80 col wide format. This one does not provide the Lua
loading code, just the const char* string.