I am facing this error when opening a text file in gedit on Ubuntu 22.04:

The file was created as a redirection of the exiftool
(12.57) command line for extracting metadata from a bunch of 100'000 photos:
for photo in $(find "/media/data/photos" -type f \( -iname "*.jpg" -o -iname "*.png" \));
do
exiftool -a -G0 -s -c '%.7f' "${photo}" >> "/media/data/output/processing.txt"
done
I also tried to open the file in Python 3.10.6 but the same kind of error occurred:
with open('/media/data/output/processing.txt','r') as f:
data = f.readlines()
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/usr/lib/python3.10/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in position 3107: invalid continuation byte
How can I find out what went wrong and, if possible, how to debug it?
Edits
$ file processing.txt
processing.txt: ASCII text
I discovered theses lines by greping the pipe character in my file:
grep -inr "|" processing.txt
28978:MakerNotes : BabyAge : |.z.�.�.�.�.�.�.�.g.
153969:MakerNotes : BabyAge : �...�.�.@.3.�.|.�.x.
239759:MakerNotes : BabyAge : .�.�.;.|.A.>.Q.=.�.
287018:MakerNotes : BabyAge : �.�.�.|.�.....K.�.5.
466938:MakerNotes : InternalSerialNumber : |.�.x.�\.v.B...
473829:MakerNotes : BabyAge : |.�.�.�...�.X.'.�.X.
475416:MakerNotes : BabyAge : |.�.�.�...�.X.'.�.X.
475777:MakerNotes : BabyAge : 4.�.|.1...P.:...�
477305:MakerNotes : InternalSerialNumber : �.|.r.|.h.�.�.O.
483418:MakerNotes : BabyAge : 6.�.J.c.`.�.H.�.|.�.
557390:MakerNotes : InternalSerialNumber : �.�.�..|.o&.3.
604471:MakerNotes : BabyAge : �.�.|.Q..A.=.9.�.�.
636619:MakerNotes : BabyAge : �.�.N.�.�.�.G.�.|...
799895:MakerNotes : InternalSerialNumber : .|�..�.�`.�.
944200:MakerNotes : BabyAge : �.�.�.|.�.r.�.�...�