Opened 15 years ago

Closed 15 years ago

#3182 closed defect (fixed)

ows_encoding ignored by wfs 1.1

Reported by: mko Owned by: aboudreault
Priority: high Milestone: 5.4.3 release
Component: MapServer C Library Version: 5.4
Severity: major Keywords: encoding wfs11
Cc: mko, aboudreault

Description

In WFS 1.1 implementation there's ISO-8859-1 hardcoded which might make clients stop reading service capabilities.

xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);

Change History (7)

comment:1 by tomkralidis, 15 years ago

Cc: aboudreault added

FYI this happens a few places in the codebase:

[devgeo:/home/tkralidi/foss4g/mapserver/svn/trunk/mapserver]$ grep xmlDocDum *.[ch]
mapogcsos.c:  xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapogcsos.c:     /*xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);*/
mapogcsos.c:     /* xmlDocDump crashs withe the prebuild windows binaries distibutes at the libxml site???.
mapogcsos.c:     xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapogcsos.c:     xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwcs11.c:  xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwcs11.c:    xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwcs11.c:        xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwfs11.c:    xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwfs11.c:    xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);

FYI related to #2583.

comment:2 by aboudreault, 15 years ago

I suppose those calls should use the "*_encoding" metadata as well?

in reply to:  2 comment:3 by tomkralidis, 15 years ago

Replying to aboudreault:

I suppose those calls should use the "*_encoding" metadata as well?

Yes.

comment:4 by aboudreault, 15 years ago

Owner: changed from sdlime to aboudreault

comment:5 by tomkralidis, 15 years ago

Actually, I wonder if we should do this everywhere we define ISO-8859-1 as default:

[devgeo:/home/tkralidi/foss4g/mapserver/svn/trunk/mapserver]$ grep "ISO-8859-1" *.[ch]
mapcontext.c:                    "ISO-8859-1");
mapgml.c:  /* "wms_encoding", and if not found then use "ISO-8859-1" as default. */
mapgml.c:  msOWSPrintEncodeMetadata(stream, &(map->web.metadata), namespaces, "encoding", OWS_NOERR, "<?xml version=\"1.0\" encoding=\"%s\"?>\n\n", "ISO-8859-1");
mapogcsos.c:      xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapogcsos.c:                             "ISO-8859-1");
mapogcsos.c:     /*xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);*/
mapogcsos.c:     xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapogcsos.c:     xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwcs11.c:  xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwcs11.c:    xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwcs11.c:        xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwcs.c:  msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), NULL, "wcs_encoding", OWS_NOERR, "<?xml version='1.0' encoding=\"%s\" ?>\n", "ISO-8859-1");
mapwcs.c:    msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), NULL, "wcs_encoding", OWS_NOERR, "<?xml version='1.0' encoding=\"%s\" standalone=\"no\" ?>\n", "ISO-8859-1");
mapwcs.c:  msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), NULL, "wcs_encoding", OWS_NOERR, "<?xml version='1.0' encoding=\"%s\" ?>\n", "ISO-8859-1");
mapwfs11.c:    xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwfs11.c:    xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1);
mapwfs.c:                "<?xml version='1.0' encoding=\"%s\" ?>\n", "ISO-8859-1");
mapwfs.c:                "ISO-8859-1");
mapwfs.c:                          "ISO-8859-1");
mapwfs.c:                             "ISO-8859-1");
mapwms.c:                    "ISO-8859-1");
mapwms.c:                         "ISO-8859-1");
mapwms.c:                           "ISO-8859-1");
mapwms.c:                           "ISO-8859-1");
mapwms.c:                "ISO-8859-1");
mapwms.c:                            "ISO-8859-1");
mapwms.c:                            "ISO-8859-1");


comment:6 by aboudreault, 15 years ago

All msOWSPrintEncodeMetadata() calls are already Ok. They already check if the metadata is present, else use the default.

comment:7 by aboudreault, 15 years ago

Resolution: fixed
Status: newclosed

The proper encoding will now be set in the xml tag for all requests. Note that if you do a SOS request, it will look for the "sos_encoding" metadata, if not found, the "ows_encoding" metadata, else "ISO-8859-1". Same thing for wms/wfs, etc.

Fixed and committed in r9498.

Note: See TracTickets for help on using tickets.