PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ encoding2codepage()

char * encoding2codepage ( const char *  encoding)

Definition at line 343 of file shpcommon.c.

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

References code_pages, and num_code_pages.

Referenced by ShpDumperOpenTable().

Here is the caller graph for this function: