You are doing all correct except that you are expecting to Notepad++ to detect character set of file. Strictly speaking ISO-8859-2 is not encoding but character set.
File that is opened by editor (any) is just plain text without headers, that you sent to browser. So editor can detect that it is single-byte encoding, but detect character set is not possible, so it is opened in default system character set.
See my answer about encoding detection
Your file has still correct encoding, but Notepad++ just displaying it incorrectly. UTF-8 encoding is another matter, because it doesn't have character sets and is always displayed correctly (i think).