>For instance it will attempt decoding from utf-8 with replacing decoding errors with question marks.
Please don't do this. Replacing with question mark is a lossy transformation. If you use a lossless transformation, a knowledgeable user of your program will be able to reverse the garbling, in their head, or using a tool. Consider åäö, the result of interpreting utf8 åäö as latin1. You could find both the reason and solution by googling on it.
Please don't do this. Replacing with question mark is a lossy transformation. If you use a lossless transformation, a knowledgeable user of your program will be able to reverse the garbling, in their head, or using a tool. Consider åäö, the result of interpreting utf8 åäö as latin1. You could find both the reason and solution by googling on it.