@@ -64,10 +64,11 @@ size_t _URLIndex; int _errorCode; OFString *_outputPath, *_currentFileName; bool _continue, _force, _detectFileName, _detectFileNameRequest; bool _detectedFileName, _quiet, _verbose, _insecure, _ignoreStatus; + bool _useUnicode; OFStream *_body; of_http_request_method_t _method; OFMutableDictionary *_clientHeaders; OFHTTPClient *_HTTPClient; char *_buffer; @@ -575,10 +576,12 @@ } if (_insecure) _HTTPClient.allowsInsecureRedirects = true; + _useUnicode = ([OFLocale encoding] == OF_STRING_ENCODING_UTF_8); + [self performSelector: @selector(downloadNextURL) afterDelay: 0]; } - (void)client: (OFHTTPClient *)client @@ -626,12 +629,16 @@ key, object]; objc_autoreleasePoolPop(pool); } - if (!_quiet) - [of_stdout writeFormat: @"☇ %@", URL.string]; + if (!_quiet) { + if (_useUnicode) + [of_stdout writeFormat: @"☇ %@", URL.string]; + else + [of_stdout writeFormat: @"< %@", URL.string]; + } _length = 0; return true; } @@ -708,11 +715,14 @@ if (!_quiet) { OFString *lengthString = [headers objectForKey: @"Content-Length"]; OFString *type = [headers objectForKey: @"Content-Type"]; - [of_stdout writeFormat: @" ➜ %hd\n", statusCode]; + if (_useUnicode) + [of_stdout writeFormat: @" ➜ %hd\n", statusCode]; + else + [of_stdout writeFormat: @" -> %hd\n", statusCode]; if (type == nil) type = OF_LOCALIZED(@"type_unknown", @"unknown"); if (lengthString != nil) { @@ -961,11 +971,12 @@ } if (!_quiet) { _progressBar = [[ProgressBar alloc] initWithLength: _length - resumedFrom: _resumedFrom]; + resumedFrom: _resumedFrom + useUnicode: _useUnicode]; [_progressBar setReceived: _received]; [_progressBar draw]; } [_currentFileName release]; @@ -1024,12 +1035,16 @@ } clientHeaders = [[_clientHeaders mutableCopy] autorelease]; if (_detectFileName && !_detectedFileName) { - if (!_quiet) - [of_stdout writeFormat: @"⠒ %@", URL.string]; + if (!_quiet) { + if (_useUnicode) + [of_stdout writeFormat: @"⠒ %@", URL.string]; + else + [of_stdout writeFormat: @"? %@", URL.string]; + } request = [OFHTTPRequest requestWithURL: URL]; request.headers = clientHeaders; request.method = OF_HTTP_REQUEST_METHOD_HEAD; @@ -1068,12 +1083,16 @@ forKey: @"Range"]; } @catch (OFRetrieveItemAttributesFailedException *e) { } } - if (!_quiet) - [of_stdout writeFormat: @"⇣ %@", URL.string]; + if (!_quiet) { + if (_useUnicode) + [of_stdout writeFormat: @"⇣ %@", URL.string]; + else + [of_stdout writeFormat: @"< %@", URL.string]; + } request = [OFHTTPRequest requestWithURL: URL]; request.headers = clientHeaders; request.method = _method;