Telegraphic ciphers and codes were common, both to save money through compression, and as it was well known that many people would be reading and re-transmitting the message as it worked its way through the system.
There were various standardized codebooks published for when the message was not secret and compression was the only consideration:
https://en.wikipedia.org/wiki/Commercial_code_(communication...
Frequent telegraph users with an additional need for secrecy, such as investment bankers, developed similar proprietary in-house codebooks.