1. Every dictionary is stored in its own encoding
2. The encoding is not utf8, but some language specific (probably to safe some space)
3. CB tries to convert the words from the encoding it has detected for the file to the encoding used by the dictionary, or vice versa. This is done in order to find matching words.
4. I doubt that the system encoding has anything to do with this process.
No, there must be another cause. For example, the Latvian dictionary is stored in UTF-8 with no BOM (see hunspell_lv.png in the attachment). The source file is also using the UTF-8. Even changing all words to the nominative case as they appear in the .dic file does not help to get rid of the curly red underlines.
I guess, some specific characters are causing this behaviour for some reason (see lv_strings_false_misspelled.png in the attachment). In addition, some words are underlined partly.
My default system encoding is Windows-1257 and the codepage for the Windows Command Prompt is 775 (the default Windows settings for the Baltic languages) but I think the Code::Blocks should not use those two encodings in any way if I have set explicitly the UTF-8 for the "Use encoding when opening files" option.
Playing with options in Editor Settings (checking-unchecking checkboxes and radio buttons under Encoding) did not change anything in the false error detection.