Actually, thinking about it, although it might be happening due to one of the plugins/assumptions in firefox in case explicit preferences are not available in the response headers; I believe basex can help the situation by setting the charset in the response.
Well, firefox or any other client will have to assume things if not available explicitly and assumptions in such a situation are bound to fail in one case or the other, so it does help if the response specifies the charset.
In particular, I do not think Firefox is to blame for the rendering in 4th query above, because the URL below states that by default assume iso-8859-1 encoding...