Closed fornewfork closed 1 month ago
Thanks for the report, @fornewfork! I have bad news and good news, unfortunately.
First: I'm sorry to tell you that that error message you've posted above is being given to you by the client side, not from the API itself. Unfortunately, that's an unavoidable reality because it's not technically possible to encode non-ASCII characters in an HTTP header; this means that, as you've discovered, using this particular feature for appending to headings that are written in non-ASCII characters is not a technical possibility with this API as it is designed today.
Good news, though: the PATCH
API is being revised in the next major release of this library. So, I'm genuinely glad that you took the time to raise this specific problem to me because until you posted this issue, I hadn't considered what limitations this API's use of HTTP headers might impose! So, in the next version of this API, we'll be adding a feature that will allow the field into which you put your target heading to be encoded for transport (see Target-Encoding
here: https://github.com/coddingtonbear/obsidian-local-rest-api/wiki/Flexible-PATCH#possible-future-api). Once that new feature is released, you should be able to accomplish what you want to do!
If you want to keep up with when that feature is released, follow https://github.com/coddingtonbear/obsidian-local-rest-api/issues/26 -- I'll be posting updates there!
Issue Description
When using the PATCH method to append content under a specific heading in a note, the operation fails if the note title contains non-ASCII characters (e.g., Chinese characters).
Steps to Reproduce
Expected Behavior
The PATCH operation should successfully append content to the specified heading, regardless of the note title's character set.
Actual Behavior
When the note title contains non-ASCII characters, the operation fails with the following error:
Additional Information