PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ encoding2codepage()

char* encoding2codepage ( const char *  encoding)

Definition at line 347 of file shpcommon.c.

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

References code_pages, and num_code_pages.

Referenced by ShpDumperOpenTable().

Here is the caller graph for this function: