Changeset 4b17a6c for util.c


Ignore:
Timestamp:
Apr 9, 2009, 12:32:56 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
9d12aa5
Parents:
e6c59ba
Message:
Zephyr: Always send in UTF-8, never iso-latin-1.
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.