At work I have this software for microfilm scanner. It saves project files in XML. I need to process them because original software doesn't have some functions and I want to add them.
I need to read this file, read some values, make calculations on those values and depending on results change the line. When all is done save it.
It's easy. I'm reading the file (loading in TMemo) and saving it. But.... there is a problem and I don't know what can be wrong. The problem is that, when I save the file it can't be opened in my scanners software (Unable to read blah blah message). It's strange because original file from scaner looks exactly the same as my file.
I didn't know if it's because my modifications are wrong or there is a problem with encoding. I made some tests.
1) I just opened the file (loaded in TMemo) and without changing saved it to another file = Unable to read file blah blah blah.
2) I opened the file (TMemo) and MANUALY CHANGE some values = Unable to read file ....
3) I loaded the file into TStringList, made my modifications, saved it and it is working fine.
So there's something wrong when saving from TMemo.
I know that original file from scaner is UTF-8 file, but my files are also UTF-8 (checked in Notepad++).
Any ideas where can be the problem?