Lets say I have a file called foo.txt encoded in utf8:
aoeu qjkx ñpyf
And I want to get an array that contains all the lines in that file
It sounds like you've already got your answer, but it is important to recognize that unicode characters can be stored in multiple ways. Unicode normalization* is a process which can help ensure comparisons work as expected.