Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plaintext output of citations does not handle unicode characters properly #91

Closed
adomasven opened this issue Dec 2, 2020 · 2 comments · Fixed by #107
Closed

Plaintext output of citations does not handle unicode characters properly #91

adomasven opened this issue Dec 2, 2020 · 2 comments · Fixed by #107
Labels
A-core Area: affects all builds of citeproc-rs I-bug Something isn't working
Milestone

Comments

@adomasven
Copy link
Member

Plaintext output of citations (at least with the previewCitationCluster()) produces output like:

\uc0\u268 otar et al., 2020

where it should be

Čotar et al., 2020

The bibliography plaintext output for unicode characters is fine.

@cormacrelf
Copy link
Collaborator

Ah, that's a dumb but easy one. Good catch.

let build = built_cluster_before_output(db, cluster_id);
let string = formatter.output(build, get_piq(db));
Arc::new(string)

What's missing here? Using the overridden formatter inside built_cluster_before_output, Cormac you idiot. Hence the Unicode encoded for RTF.

@stakats stakats added this to the Zotero Beta milestone Apr 13, 2021
@cormacrelf
Copy link
Collaborator

Turns out this code was fine. You need to pass one of "html", "rtf" or "plain", and it was not raising an error when it wasn't one of these, it just silently used the driver's default output format. I've got a PR to make it raise errors & document slightly more, but you'll have to check that you're not writing "plaintext" instead of "plain".

@cormacrelf cormacrelf added A-core Area: affects all builds of citeproc-rs I-bug Something isn't working labels Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: affects all builds of citeproc-rs I-bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants