| | 258 | static void add_value_decoded(VFormatAttribute *attr, const char *value, const char *encoding) |
| | 259 | { |
| | 260 | if (needs_charset((unsigned char*)value)) |
| | 261 | if (!vformat_attribute_has_param (attr, "CHARSET")) |
| | 262 | vformat_attribute_add_param_with_value(attr, "CHARSET", "UTF-8"); |
| | 263 | |
| | 264 | if (needs_encoding((unsigned char*)value, encoding)) { |
| | 265 | if (!vformat_attribute_has_param (attr, "ENCODING")) |
| | 266 | vformat_attribute_add_param_with_value(attr, "ENCODING", encoding); |
| | 267 | vformat_attribute_add_value_decoded(attr, value, strlen(value) + 1); |
| | 268 | } else |
| | 269 | vformat_attribute_add_value(attr, value); |
| | 270 | } |
| | 271 | |
| 263 | | |
| 264 | | if (needs_charset((unsigned char*)tmp)) |
| 265 | | if (!vformat_attribute_has_param (attr, "CHARSET")) |
| 266 | | vformat_attribute_add_param_with_value(attr, "CHARSET", "UTF-8"); |
| 267 | | |
| 268 | | if (needs_encoding((unsigned char*)tmp, encoding)) { |
| 269 | | if (!vformat_attribute_has_param (attr, "ENCODING")) |
| 270 | | vformat_attribute_add_param_with_value(attr, "ENCODING", encoding); |
| 271 | | vformat_attribute_add_value_decoded(attr, tmp, strlen(tmp) + 1); |
| 272 | | } else |
| 273 | | vformat_attribute_add_value(attr, tmp); |
| | 277 | |
| | 278 | add_value_decoded(attr, tmp, encoding); |
| | 279 | |