Hello!
I am using Octave for Windows (octave-forge)
I was trying to import a text file that was spit out by our CAD software into a nice octave matrix.
But this was not successful due to a problem with the encoding. I can not completly figure out
why this happens and hope that you can help me.
My text editor tells me that file from the CAD software is encoded in "UCS-2 Little Endian".
Just trying to read this file unmodified results in a row of strange characters in the output file
that I am trying to export.
The input file looks like this:
---
0.000 28.500
607.143 25.357
1214.286 22.903
1821.429 20.976
2428.571 19.448
---
Some code I am using:
---
fin = fopen(filename_input, 'rt');
...
s_old = fgetl(fin);
...
---
It seems that only the first line is read wrong, because if I display
all the lines read into the variable s_old it shows that typical ascii-rectangle followed by the
numbers it should show:
s_old = ■0 , 0 0 0 2 8 , 5 0 0
All other rows look fine.
If I convert the input-file into ANSI or UTF8 before by using the text editor everything works fine.
Since this calculation has to be done to a lot of text files manually converting them to
a different encoding is not a solution.
Can I somehow change the input format that Octave accepts? Or can someone tell me
another solution to this?
Kind regards,
Walter
_______________________________________________