Skip to content

Conversation

@cnaples79
Copy link

Summary

Accept as an optional kwarg for the built-in filter, matching Jinja usage like . The flag is accepted and ignored (nlohmann::json dumps UTF-8 by default), preventing an "Unknown argument ensure_ascii" error.

Changes

  • Extend signature to include (optional), preserve existing behavior.
  • Add a unit test verifying renders without error.

Rationale

Some templates (e.g., in LLM contexts) call . Previously, this caused a runtime error. This change improves compatibility without altering output semantics.

Fixes #82

…google#82)\n\n- Extend built-in tojson to accept optional ensure_ascii (ignored, preserves UTF-8 default)\n- Add test ensuring tojson(ensure_ascii=False) does not error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error tojson(ensure_ascii=False)

1 participant