Hi,

I need to change escape characters in my text document (for example change every \r to \n). What is the best way to do that using Qt and C++? I don't want to make any assumptions about the format (Win or Mac) while reading in the data.

I typically use QTextStream and readLine() to read text into QString and then I use replace() to make changes. Here I have two problems:
1. readLine loses newline characters (line breaks) - main problem
2. My entire document may be too large to fit in a QString - small problem

Are there any tricks to replacing escape characters compared to replacing simple letters or numbers?

Thanks!