[mapserver-commits] r11396 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Mar 30 15:57:35 EDT 2011


Author: sdlime
Date: 2011-03-30 12:57:35 -0700 (Wed, 30 Mar 2011)
New Revision: 11396

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapstring.c
Log:
Applied patch to filter unwanted fribidi characters. (#3763)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-03-30 19:35:01 UTC (rev 11395)
+++ trunk/mapserver/HISTORY.TXT	2011-03-30 19:57:35 UTC (rev 11396)
@@ -15,6 +15,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Applied patch to filter unwanted fribidi characters (#3763)
+
 - Fixed lexer to set the proper state on URL variable substitutions
 
 - Fixed Memory leak in PostGIS driver (#3768)
@@ -81,6 +83,7 @@
 
 - SLD: Text Symbolizer now uses the new expression syntax (#3757)
 
+>>>>>>> .r11395
 - WFS: correct bbox values for GetFeature with featureid request (#3761) 
 
 - Mapscript Seg Fault on mapObj->getMetaData (#3738)

Modified: trunk/mapserver/mapstring.c
===================================================================
--- trunk/mapserver/mapstring.c	2011-03-30 19:35:01 UTC (rev 11395)
+++ trunk/mapserver/mapstring.c	2011-03-30 19:57:35 UTC (rev 11396)
@@ -1593,6 +1593,7 @@
     FriBidiLevel *levels;
     FriBidiStrIndex new_len;
     fribidi_boolean log2vis;
+    int i, j;
 
     visual = (FriBidiChar *) msSmallMalloc (sizeof (FriBidiChar) * (len + 1));
     ltov = NULL;
@@ -1626,6 +1627,22 @@
      new_len =
        fribidi_unicode_to_charset (from_char_set_num,
            visual, len, outstring);
+
+    /* scan str and compress out FRIBIDI_CHAR_FILL UTF8 characters */
+
+    for (i=0, j=0; i<new_len; i++, j++)
+    {
+      if (outstring[i] == '\xef' && outstring[i+1] == '\xbb' && outstring[i+2] == '\xbf')
+      {
+         i += 3;
+      }
+      if (i != j)
+      {
+        outstring[j] = outstring[i];
+      }
+    }
+    outstring[j] = '\0';
+
 #endif
      return msStrdup(outstring);
   }



More information about the mapserver-commits mailing list