From: Jim W. <ji...@pa...> - 2003-10-13 04:41:47
|
Hi Tim, Simon, Tim Pizey wrote: >Hi Simon, > >On Thursday 09 October 2003 4:08 pm, yflei wrote: > > >> I am reading the source code, but don't have a >>clear concept yet. Would you please give me some >>suggestions on how to read the codes? Thanks. >> >> [snip] >The locale is passed through into all the rel;evant functions, >I believe, so search for locale >and MelatiLocale. There are quite a few aspects to this. Personally I don't think the locale has got much to do with it. This affects date formats etc. I'm glad you two are addressing webmacro questions! I have hacked the code to use XML numeric character references in elements and attributes for characters that the response encoding (already chosen) is not known to support. It doesn't work exactly as expected. This is possibly a problem with input and not output. But instead of commiting I will send a long-ish and incomplete patch to the melati-developers list (and CC Simon) to give you an idea. Here are some other thoughts... It seems to me that the response encoding should depend on the request. HTTPServletRequest.getHeader("accept-charset") might return a string like " ISO-8859-2, utf-8;q=0.66, *;q=0.66". So we could start by trying to set named encodings in order of decreasing q value. Otherwise I suggest ServletRequest.getCharacterEncoding() returns an encoding which should be good for the response I'm not sure if this value comes from the same place as ServletRequest.getContentType(). I am wondering whether Melati.getEncoding() is assuming a chosen encoding has been configured in the response or whether it should actually be checking the request. Regards, Jim -- Recently completed - Child Brain Injury Trust Admin System http://cbitdemo.paneris.org/ Urgently seeking paid work Java, Linux, XML and much more. http://be.webz.cz/ |