Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • util.c

    rf34dd65 r4b17a6c  
    725725  }
    726726}
    727 /* Attempts to convert 'in' to ISO-8859-1. Returns that if possible,
    728    else returns UTF-8.
     727/*
     728 * Validate 'in' as UTF-8, and either return a copy of it, or an empty
     729 * string if it is invalid utf-8.
    729730 */
    730 char * owl_get_iso_8859_1_if_possible(char *in)
     731char * owl_validate_utf8(char *in)
    731732{
    732733  char *out;
    733734  if (g_utf8_validate(in, -1, NULL)) {
    734     out = g_convert(in, -1,
    735                     "ISO-8859-1", "UTF-8",
    736                     NULL, NULL, NULL);
    737     if (!out) {
    738       out = owl_strdup(in);
    739     }
    740   }
    741   else {
     735    out = owl_strdup(in);
     736  } else {
    742737    out = owl_strdup("");
    743738  }
Note: See TracChangeset for help on using the changeset viewer.