in reply to Encoding problem with function in C library

chcp 1252

Number 177 or 0xB1 is hard-coded in your dll, but it's "medium shade block" character in CP850 or CP437 which terminal uses, for (supposedly still used) DOS programs to display their output as expected.