I know this isn’t the answer you are looking for, but would you be able to possibly write the text to something and read the text from that, then possibly be able to convert the text you just read.
Just write text to temp.csv, read text from temp.csv, convert.
Best of luck!