PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ encoding2codepage()

char* encoding2codepage ( const char *  encoding)

Definition at line 259 of file shpcommon.c.

References code_pages, and num_code_pages.

Referenced by ShpDumperOpenTable().

260 {
261  int i;
262  for ( i = 0; i < num_code_pages; i++ )
263  {
264  if ( strcasecmp(encoding, code_pages[i].pg) == 0 )
265  {
266  if ( code_pages[i].ldid == 0xFF )
267  {
268  return strdup("UTF-8");
269  }
270  else
271  {
272  char *codepage = NULL;
273  asprintf(&codepage, "LDID/%d", code_pages[i].ldid);
274  return codepage;
275  }
276  }
277  }
278 
279  /* OK, we give up, pretend it's UTF8 */
280  return strdup("UTF-8");
281 }
static code_page_entry code_pages[]
Definition: shpcommon.h:43
static int num_code_pages
Definition: shpcommon.h:38
Here is the caller graph for this function: