I am browsing some Chinese webpage, where all the encodings are shown correctly until when a small window (by javascript? I don't know) is open and inside it the Chinese characters are messed up. The encoding Firefox uses to browse the webpage is GB2312.

I was wondering why this happens and how I deal with it?
My Firefox is 3.6.17 and my OS is Ubuntu 10.10.
Thanks and regards!