Ticket #2529 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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:
Cc:

Description

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;
 #else
+  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;
 #endif

ned.

Change History

Changed 5 years ago by dmorissette

  • status changed from new to closed
  • resolution set to fixed

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

Note: See TracTickets for help on using tickets.