Changeset 1703


Ignore:
Timestamp:
Apr 11, 2007, 6:26:38 PM (15 years ago)
Author:
livings124
Message:

better handle non-UTF8 error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r1682 r1703  
    956956- (NSString *) errorMessage
    957957{
    958     return [self isError] ? [NSString stringWithUTF8String: fStat->errorString] : @"";
     958    if (![self isError])
     959        return @"";
     960   
     961    #warning localize string after release
     962    NSString * error;
     963    if (!(error = [NSString stringWithUTF8String: fStat->errorString])
     964        && !(error = [NSString stringWithCString: fStat->errorString encoding: NSISOLatin1StringEncoding]))
     965        error = @"";
     966        //error = NSLocalizedString(@"(unreadable error)", "Torrent -> error string unreadable");
     967   
     968    return error;
    959969}
    960970
Note: See TracChangeset for help on using the changeset viewer.