You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An AsciiDoc processor assumes that all input is either UTF-8 encoded or properly labeled. See https://docs.asciidoctor.org/asciidoc/latest/normalization/. It's likely that when Hugo runs the asciidoctor command using the system call, it ends up causing mislabeled data to be passed to Asciidoctor. The proposed change would be reverting the change made for #2764. You can find information about how to relabel the strings in the following comment: #2764 (comment)
Here's what I would be willing to do. We could try .encode and if that fails, fall back to force_encoding. In other words:
I solved this problem by modifying the source code, but I hope that this issue can also be updated in the main asciidoctor version, because, if the user passes a non-utf_8 string, then compatibility should also be done
Thank you for testing. Let me update the code and I'll get back to you once I have something new to test.
The reason I cannot accept the code as you wrote it is that it would break compatibility with strings that are properly labeled. But I think we can find a way to support both cases.
Activity
mojavelinux commentedon Sep 8, 2022
An AsciiDoc processor assumes that all input is either UTF-8 encoded or properly labeled. See https://docs.asciidoctor.org/asciidoc/latest/normalization/. It's likely that when Hugo runs the asciidoctor command using the system call, it ends up causing mislabeled data to be passed to Asciidoctor. The proposed change would be reverting the change made for #2764. You can find information about how to relabel the strings in the following comment: #2764 (comment)
Here's what I would be willing to do. We could try .encode and if that fails, fall back to force_encoding. In other words:
Can you try that logic and see if it works for you?
zkaip commentedon Sep 9, 2022
I solved this problem by modifying the source code, but I hope that this issue can also be updated in the main asciidoctor version, because, if the user passes a non-utf_8 string, then compatibility should also be done
mojavelinux commentedon Sep 9, 2022
zkaip commentedon Sep 9, 2022
@mojavelinux you code not worked...
if I changed the code as the follow

then the result is follow

mojavelinux commentedon Sep 9, 2022
Thank you for testing. Let me update the code and I'll get back to you once I have something new to test.
The reason I cannot accept the code as you wrote it is that it would break compatibility with strings that are properly labeled. But I think we can find a way to support both cases.
mojavelinux commentedon Sep 9, 2022
Can you try this code instead? It looks like I had the name of the error class wrong
zkaip commentedon Sep 9, 2022
@mojavelinux Yes, this code resolved the problem.
mojavelinux commentedon Sep 9, 2022
Thanks for verifying! I'll go ahead and proceed with that change.
resolves asciidoctor#4351 force encoding of attribute data passed via…
10 remaining items