[Geoserver-devel] [jira] Created: (GEOS-693) GeoServer.getMimeType() returns incorect Charset name

GeoServer.getMimeType() returns incorect Charset name
-----------------------------------------------------

                 Key: GEOS-693
                 URL: http://jira.codehaus.org/browse/GEOS-693
             Project: GeoServer
          Issue Type: Bug
          Components: WFS
    Affects Versions: 1.4.0-M1, 1.4.0-M0, 1.3.3, 1.3.2, 1.3.1
         Environment: WebSphere 6, Windows 2003 Server

D:\>D:\IBM\WebSphere\AppServer\java\bin\java.exe -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM Windows 32 build cn142-20060421 (SR5) (J
IT enabled: jitc))
            Reporter: Mark Presling
         Assigned To: dblasby
            Priority: Minor

GeoServer returns the wrong HTTP Content Type header when running on WebSphere. It returns "charset=UTF-8: Unicode UTF-8" instead of just "charset=UTF-8".

This is caused by the GeoServer.getMimeType() method calling the wrong method on java.nio.charset.Charset. It currently calls getCharSet().displayName() where it should be calling getCharSet().name()

This code:
        Charset cs = Charset.forName("UTF-8");
        System.out.println(cs.displayName());
        System.out.println(cs.name());
        System.out.println(cs.toString());
        System.out.println(Charset.availableCharsets().keySet());

creates this output:
D:\>D:\IBM\WebSphere\AppServer\java\bin\java.exe CharSetTest
UTF-8: Unicode UTF-8
UTF-8
UTF-8
[Big5, CESU-8, COMPOUND_TEXT, EUC-CN, EUC-JP, EUC-KR, EUC-TW, GB18030, GB2312, G
BK, hp-roman8, IBM-037, IBM-1006, IBM-1025, IBM-1026, IBM-1027, IBM-1041, IBM-10
43, IBM-1046, IBM-1046S, IBM-1047, IBM-1088, IBM-1097, IBM-1098, IBM-1112, IBM-1
114, IBM-1115, IBM-1122, IBM-1123, IBM-1124, IBM-1140, IBM-1141, IBM-1142, IBM-1
143, IBM-1144, IBM-1145, IBM-1146, IBM-1147, IBM-1148, IBM-1149, IBM-1351, IBM-1
362, IBM-1363, IBM-1363C, IBM-1364, IBM-1370, IBM-1371, IBM-1380, IBM-1381, IBM-
1382, IBM-1383, IBM-1385, IBM-1386, IBM-1388, IBM-1390, IBM-1399, IBM-273, IBM-2
77, IBM-278, IBM-280, IBM-284, IBM-285, IBM-290, IBM-297, IBM-300, IBM-301, IBM-
33722, IBM-33722C, IBM-420, IBM-420S, IBM-424, IBM-437, IBM-500, IBM-720, IBM-73
7, IBM-775, IBM-808, IBM-833, IBM-834, IBM-835, IBM-836, IBM-837, IBM-838, IBM-8
50, IBM-852, IBM-855, IBM-856, IBM-857, IBM-858, IBM-859, IBM-860, IBM-861, IBM-
862, IBM-863, IBM-864, IBM-864S, IBM-865, IBM-866, IBM-867, IBM-868, IBM-869, IB
M-870, IBM-871, IBM-874, IBM-875, IBM-897, IBM-918, IBM-921, IBM-922, IBM-924, I
BM-927, IBM-930, IBM-932, IBM-933, IBM-935, IBM-937, IBM-939, IBM-942, IBM-942C,
IBM-943, IBM-943C, IBM-947, IBM-948, IBM-949, IBM-949C, IBM-950, IBM-951, IBM-9
54, IBM-954C, IBM-964, IBM-971, ISCII91, ISO-2022-CN, ISO-2022-CN-GB, ISO-2022-J
P, ISO-2022-KR, ISO-8859-1, ISO-8859-10, ISO-8859-13, ISO-8859-14, ISO-8859-15,
ISO-8859-16, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-885
9-6S, ISO-8859-7, ISO-8859-8, ISO-8859-9, JIS0201, JIS0208, JIS0212, Johab, KOI8
-R, KOI8-RU, KOI8-U, KSC5601, MacArabic, MacCentralEurope, MacCroatian, MacCyril
lic, MacDingbat, MacGreek, MacHebrew, MacIceland, MacRoman, MacRomania, MacSymbo
l, MacThai, MacTurkish, MacUkraine, PTCP154, Shift_JIS, TIS-620, US-ASCII, UTF-1
6, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, UTF-8, UTF-8J, windows-1250,
windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-12
56, windows-1256S, windows-1257, windows-1258, windows-874, windows-932, windows
-936, windows-949, windows-950, X-UnicodeBig, X-UnicodeLittle]

Other than that, it seems to be working correctly under WebSphere. Note however that I have embedded a stripped down version of GeoServer WFS into my own webapp.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira