Opened 16 years ago

Closed 16 years ago

#2529 closed defect (fixed)

Make UTF-8 encoding work even without Iconv support

Reported by: dmorissette Owned by: dmorissette
Priority: normal Milestone: 5.2 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:


Posted by Ned Harding to mapserver-dev on 2008-02-26:

Hey All, Here is a tiny little patch I would propose. It makes UTF-8 (and only UTF-8) encoding work on windows without having iconv.h. Seems like it wouldn't have any side effects - it is certainly working for me...

Index: S:/3rdParty/GIS/MapServer/mapstring.c
--- S:/3rdParty/GIS/MapServer/mapstring.c (revision 14821)
+++ S:/3rdParty/GIS/MapServer/mapstring.c (working copy)
@@ -1072,6 +1072,9 @@
   return out;
+  if (*string == 0 || (encoding && strcasecmp(encoding, "UTF-8")==0))
+      return strdup(string);    /* Nothing to do: string already in
UTF-8 */
   msSetError(MS_MISCERR, "Not implemeted since Iconv is not enabled.", "msGetEncodedString()");
   return NULL;


Change History (1)

comment:1 by dmorissette, 16 years ago

Resolution: fixed
Status: newclosed

Fixed. I have applied this patch in trunk in r7417.

Note: See TracTickets for help on using tickets.