Changeset 3a27896


Ignore:
Timestamp:
2015-06-04T17:13:22Z (10 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
56c8a4f
Parents:
1cef55f
git-author:
dequis <dx@…> (01-06-15 04:57:33)
git-committer:
dequis <dx@…> (04-06-15 17:13:22)
Message:

nick_gen: retry g_convert_with_fallback without TRANSLIT if it fails

Based on patch from trac ticket #1152. Quoting:

NetBSD's implementation of iconv does not appear to support TRANSLIT.
This means g_convert_with_fallback() called with
TRANSLIT will always fail

Removed the log_message part of the patch since that's daemon level logging
and it's unlikely to fail twice anyway (even if it did, it wouldn't crash)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nick.c

    r1cef55f r3a27896  
    186186                   LC_CTYPE being set to something other than C/POSIX. */
    187187                if (!(irc && irc->status & IRC_UTF8_NICKS)) {
    188                         part = asc = g_convert_with_fallback(part, -1, "ASCII//TRANSLIT",
    189                                                              "UTF-8", "", NULL, NULL, NULL);
     188                        asc = g_convert_with_fallback(part, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, NULL, NULL);
     189
     190                        if (!asc) {
     191                                /* If above failed, try again without //TRANSLIT.
     192                                   //TRANSLIT is a GNU iconv special and is not POSIX.
     193                                   Other platforms may not support it. */
     194                                asc = g_convert_with_fallback(part, -1, "ASCII", "UTF-8", "", NULL, NULL, NULL);
     195                        }
     196
     197                        part = asc;
    190198                }
    191199
Note: See TracChangeset for help on using the changeset viewer.