'8086 Assembly Int 21h and Extended ASCII characters

I need some help with an assignment. I need to process a plain text file in ASCII and return how many characters of each code are present (how many a's, how many b's, and so on). It works now almost perfectly.

I now have the problem that, if there is an extended ASCII character on the file, when I use the 3fh service interruption, it doesn't read them well.

For example, if the file has an é (ascii code 130), it reads an ß (ascii code 225). I'm afraid I'm using the interrupt wrong, but I wouldn't know what to do, so a little help here would be greatly appreciated. Debugging also doesn't help, because the interrupt is executed well without errors, it just returns with the wrong values in the buffer.

This is the exact code I'm using to read the file. I have the handle from a previous interrupt.

      xor ax,ax
      lea dx, buffer        
      mov ah,3fh            
      mov bx,handle         
      mov cx,4096           
      int 21h               

Thanks!

EDIT

I found the problem, but no idea how to solve it. Turns out that the character read as a 225 it's not é, but á. The code for á should be 160 according to every ASCII table i've found... but it's 225 in Unicode... Which is weird, since I'm specifically telling Notepad to save it as ANSI, not ASCII...



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source