I am trying to display data from database (Shift_JIS format) on a
JSP. The data being displayed is garbage as encoding of page is Western European, fair enough.
If I change the encoding of page by <@page > directive of main page(which includes other jsps) to shift_jis, the encoding is set properly but data is still garbage.
If I display data by not setting encoding of main.jsp to shift_jis, it takes default encoding as Western European and displays garbage as mentioned earlier, however, if I change the encoding of browser to Shift_JIS (by browser menu)the data is displayed correctly. I am a bit confused as how is browser menu setting encoding different from setting it in JSP.
The data being displayed if from a session scoped bean which is populated by
servlet.
I am not sure about where does the problem lie(I tried reconstructing
string in bean by specifying str.getBytes(), "SJIS") but didn't work.
Regards,
Bhushan