using support::changeExtension;
using support::contains;
using support::copy;
-using support::FileName;
+using support::DocFileName;
using support::findtexfile;
using support::isFileReadable;
using support::latex_path;
// use such filenames.)
// Otherwise, store the (maybe absolute) path to the original,
// unmangled database name.
- typedef boost::char_separator<char> Separator;
- typedef boost::tokenizer<Separator> Tokenizer;
-
- Separator const separator(",");
- Tokenizer const tokens(to_utf8(getParam("bibfiles")), separator);
+ typedef boost::char_separator<char_type> Separator;
+ typedef boost::tokenizer<Separator, docstring::const_iterator, docstring> Tokenizer;
+
+ Separator const separator(from_ascii(",").c_str());
+ // The tokenizer must not be called with temporary strings, since
+ // it does not make a copy and uses iterators of the string further
+ // down. getParam returns a reference, so this is OK.
+ Tokenizer const tokens(getParam("bibfiles"), separator);
Tokenizer::const_iterator const begin = tokens.begin();
Tokenizer::const_iterator const end = tokens.end();
- std::ostringstream dbs;
+ odocstringstream dbs;
for (Tokenizer::const_iterator it = begin; it != end; ++it) {
- string const input = trim(*it);
+ docstring const input = trim(*it);
+ // FIXME UNICODE
+ string utf8input(to_utf8(input));
string database =
- normalize_name(buffer, runparams, input, ".bib");
+ normalize_name(buffer, runparams, utf8input, ".bib");
string const in_file = database + ".bib";
if (!runparams.inComment && !runparams.dryrun && !runparams.nice &&
isFileReadable(in_file)) {
// mangledFilename() needs the extension
- database = removeExtension(FileName(in_file).mangledFilename());
+ database = removeExtension(DocFileName(in_file).mangledFilename());
string const out_file = makeAbsPath(database + ".bib",
buffer.getMasterBuffer()->temppath());
if (it != begin)
dbs << ',';
- dbs << latex_path(database);
+ // FIXME UNICODE
+ dbs << from_utf8(latex_path(database));
}
- // FIXME UNICODE
- docstring const db_out = from_utf8(dbs.str());
+ docstring const db_out = dbs.str();
// Post this warning only once.
static bool warned_about_spaces = false;
isFileReadable(in_file)) {
// use new style name
base = removeExtension(
- FileName(in_file).mangledFilename());
+ DocFileName(in_file).mangledFilename());
string const out_file = makeAbsPath(base + ".bst",
buffer.getMasterBuffer()->temppath());
bool const success = copy(in_file, out_file);