PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ encoding2codepage()

char* encoding2codepage ( const char *  encoding)

Definition at line 357 of file shpcommon.c.

358 {
359  int i;
360  for ( i = 0; i < num_code_pages; i++ )
361  {
362  if ( strcasecmp(encoding, code_pages[i].pg) == 0 )
363  {
364  if ( code_pages[i].ldid == 0xFF )
365  {
366  return strdup("UTF-8");
367  }
368  else
369  {
370  char *codepage = NULL;
371  int ret = asprintf(&codepage, "LDID/%d", code_pages[i].ldid);
372  if ( ret == -1 ) return NULL; /* return null on error */
373  return codepage;
374  }
375  }
376  }
377 
378  /* OK, we give up, pretend it's UTF8 */
379  return strdup("UTF-8");
380 }
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: