Implement puts replacement to handle OEM codepages