PostGIS  2.3.7dev-r@@SVN_REVISION@@
char* encoding2codepage ( const char *  encoding)

Definition at line 341 of file shpcommon.c.

References num_code_pages.

Referenced by ShpDumperOpenTable().

342 {
343  int i;
344  for ( i = 0; i < num_code_pages; i++ )
345  {
346  if ( strcasecmp(encoding, code_pages[i].pg) == 0 )
347  {
348  if ( code_pages[i].ldid == 0xFF )
349  {
350  return strdup("UTF-8");
351  }
352  else
353  {
354  char *codepage = NULL;
355  int ret = asprintf(&codepage, "LDID/%d", code_pages[i].ldid);
356  if ( ret == -1 ) return NULL; /* return null on error */
357  return codepage;
358  }
359  }
360  }
361 
362  /* OK, we give up, pretend it's UTF8 */
363  return strdup("UTF-8");
364 }
static code_page_entry code_pages[]
Definition: shpcommon.c:36
static int num_code_pages
Definition: shpcommon.c:31

Here is the caller graph for this function: