Changeset 5098

Show
Ignore:
Timestamp:
01/03/10 21:47:04 (2 years ago)
Author:
pramsey
Message:

Remove the ifdef/endif blocks for HAVE_ICONV (#367)

Location:
trunk/loader
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/loader/shp2pgsql-cli.c

    r5040 r5098  
    4040        printf("  -I  Create a spatial index on the geocolumn.\n"); 
    4141        printf("  -S  Generate simple geometries instead of MULTI geometries.\n"); 
    42 #ifdef HAVE_ICONV 
    4342        printf("  -W <encoding> Specify the character encoding of Shape's\n"); 
    4443        printf("     attribute column. (default : \"ASCII\")\n"); 
    45 #endif 
    4644        printf("  -N <policy> NULL geometries handling policy (insert*,skip,abort)\n"); 
    4745        printf("  -n  Only import DBF file.\n"); 
     
    140138 
    141139                        case 'W': 
    142 #ifdef HAVE_ICONV 
    143140                                config->encoding = optarg; 
    144 #else 
    145                                 fprintf(stderr, "WARNING: the -W switch will have no effect. UTF8 disabled at compile time\n"); 
    146 #endif 
    147141                                break; 
    148142 
  • trunk/loader/shp2pgsql-core.c

    r5090 r5098  
    4141 */ 
    4242 
    43 #ifdef HAVE_ICONV 
    4443char *utf8(const char *fromcode, char *inputbuf); 
    45 #endif 
    4644void vasbappend(stringbuffer_t *sb, char *fmt, ... ); 
    4745char *escape_copy_string(char *str); 
     
    7876} 
    7977 
    80  
    81 #ifdef HAVE_ICONV 
    8278/* Return allocated string containing UTF8 string converted from encoding fromcode */ 
    8379char * 
     
    112108        return outputbuf; 
    113109} 
    114 #endif 
    115  
    116110 
    117111/** 
     
    895889        char name2[MAXFIELDNAMELEN]; 
    896890        DBFFieldType type = -1; 
    897 #ifdef HAVE_ICONV 
    898891        char *utf8str; 
    899 #endif 
    900892 
    901893        /* If we are reading the entire shapefile, open it */ 
     
    11501142                state->precisions[j] = field_precision; 
    11511143 
    1152 #ifdef HAVE_ICONV 
    11531144                if (state->config->encoding) 
    11541145                { 
     
    11641155                        free(utf8str); 
    11651156                } 
    1166 #endif 
    11671157 
    11681158                /* 
     
    12421232        stringbuffer_clear(sb); 
    12431233 
    1244 #ifdef HAVE_ICONV 
    12451234        /* Set the client encoding if required */ 
    12461235        if (state->config->encoding) 
     
    12481237                vasbappend(sb, "SET CLIENT_ENCODING TO UTF8;\n"); 
    12491238        } 
    1250 #endif 
    12511239 
    12521240        /* Use SQL-standard string escaping rather than PostgreSQL standard */ 
     
    14731461        char *escval; 
    14741462        char *geometry, *ret; 
    1475 #ifdef HAVE_ICONV 
    14761463        char *utf8str; 
    1477 #endif 
    14781464        int res, i; 
    14791465 
     
    15831569                        } 
    15841570 
    1585 #ifdef HAVE_ICONV 
    15861571                        if (state->config->encoding) 
    15871572                        { 
     
    15971582                                free(utf8str); 
    15981583                        } 
    1599 #endif 
    16001584 
    16011585                        /* Escape attribute correctly according to dump format */ 
  • trunk/loader/shp2pgsql-core.h

    r5063 r5098  
    2121#include <sys/types.h> 
    2222#include <sys/stat.h> 
     23#include <iconv.h> 
    2324 
    2425#include "shapefil.h" 
     
    2627 
    2728#include "../liblwgeom/liblwgeom.h" 
    28  
    29 #ifdef HAVE_ICONV 
    30 #include <iconv.h> 
    31 #endif 
    3229 
    3330#include "stringbuffer.h"