This can only be done using a hardware convertor.
These are widely available (google "RS223 RS485 convertor).
Most require some form of external power supply so making them hard to implement.
However, a few actually get their power directly from the RS232 handshake lines, and thus require no external power supply.
B+B electronics make some very good ones that I have used in the past and they are available here.
Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots.
So far, the universe is winning...