-
Notifications
You must be signed in to change notification settings - Fork 326
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
ERROR: InvalidCharacterError: The string to be encoded contains characters outside of the Latin1 range. #11358
Comments
We need you to fill the issue template entirely, especially the part about providing a small reproducible example. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
For the simple example, it works. |
I downloaded the latest version v1.5.57 from GitHub, intead of from the website. The issue resolved. |
@ShixiangWang that's not at all the same version. |
@ShixiangWang If you could at least share what the content of your project looks like. It is probably related to encoding. Error is thrown in
which we use to encode things around and avoid some escaping issue. For example in Quarto 1.6, we did solve something regarding listing categories. Do you use some categories and listing with specific characters ? I believe This is all just assumption. Can you confirm anything related to this in your project ? Thank you ! |
Ok I confirmed it myself. Thanks for reporting !
❯ quarto render
[1/4] about.qmd
[2/4] index.qmd
ERROR: InvalidCharacterError: The string to be encoded contains characters outside of the Latin1 range.
Stack trace:
at btoa (ext:deno_web/05_base64.js:52:13)
at Object.utilities.metadataAttrs (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/project/types/website/listing/website-listing-template.ts:458:28)
at eval (eval at <anonymous> (https://cdn.skypack.dev/-/lodash@v4.17.21-K6GEbP02mWFnLA45zAmi/dist=es2019,mode=imports/unoptimized/template.js:58:12), <anonymous>:51:29)
at renderEjs (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/core/ejs.ts:39:16)
at include (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/core/ejs.ts:64:18)
at partial (eval at <anonymous> (https://cdn.skypack.dev/-/lodash@v4.17.21-K6GEbP02mWFnLA45zAmi/dist=es2019,mode=imports/unoptimized/template.js:58:12), <anonymous>:9:40)
at eval (eval at <anonymous> (https://cdn.skypack.dev/-/lodash@v4.17.21-K6GEbP02mWFnLA45zAmi/dist=es2019,mode=imports/unoptimized/template.js:58:12), <anonymous>:13:2)
at renderEjs (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/core/ejs.ts:39:16)
at templateMarkdownHandler (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/project/types/website/listing/website-listing-template.ts:176:26)
at markdownHandler (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/project/types/website/listing/website-listing.ts:362:14) So categories can't be UTF-8 characters anymore - this is a regression compared to Quarto 1.5 as it renders ok. It follows |
@cderv Thanks for your kind reply, I don't know and understand the technical details, so I did not provide a reproducible case (my repo is https://github.com/ShixiangWang/ShixiangWang.github.io). I am happy to see that you have generated an example. |
Thanks for providing the repo ! That is really helpful, and confirm what I found. You have UTF-8 character in your categories. I'll try something and test also on your repo. Thanks ! |
Yes I have a fix for this part already, but I am trying to get #11177 really fixing the apostrophe in category, as in fact it is not working. Took me a while to get to the bottom of it, but a I did not push the branch yet, but I am on it. I'll share before merging as I used |
@cderv Huh, I'm surprised - we have a test for that in the PR: https://github.com/quarto-dev/quarto-cli/blob/ef1648deebe7ae5b5eaa232301f26331ae61df32/tests/docs/smoke-all/2024/10/23/issue-10829/posts/post-with-code/index.qmd |
Yes but it is not testing our JS logic |
Bug description
Steps to reproduce
No response
Expected behavior
No response
Actual behavior
No response
Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: