I can not modify this working code. Is there solution to fix this issue?
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
I'm confused. What does this particular HTML error have to do with the character-encoding of your page? And your question is, how can you make the page validate when you're unable to change the code?
The validator trips over the DIV tags, which are block-level elements, that are placed within SPAN tags (an inline element). If you can't alter the code to take out those SPAN tags, you can't make this validate.
Also, if you can post the code here, how can it be that you cannot alter it? Or are you saying that you cannot alter the code without breaking the layout?
You have two problems there, the block level divs are not valid inside the inline elements span *and* li.
The simplest solution (though it's still twisted up) is to change the inner divs to span and assign a display:block to them to emulate block displays. At least it will validate, but other problems may arise (block level elements inside inline elements = bound to be difficult.)
The cleanest solution would be to break all that down into li -> span -> a . . . but you claim you can't mod it so don't know what you'll do.