Skip to content

makeboxes eval_infix should use always the internal utf encoding. - #1892

Merged
mmatera merged 3 commits into
masterfrom
MakeBoxes_uses_utf_encoding
Aug 16, 2026
Merged

makeboxes eval_infix should use always the internal utf encoding.#1892
mmatera merged 3 commits into
masterfrom
MakeBoxes_uses_utf_encoding

Conversation

@mmatera

@mmatera mmatera commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

MakeBoxes should produce strings that do not depend on $SystemCharacterEncoding. The encoding must be taken into account just at the rendering step (when converting the Box expression into a string or LaTeX output). This PR fixes the remaining place where this pattern was not followed and produced errors when call pytest /test/format/test_format.py with "ASCII" as the system encoding. With this adjustment, tests pass regardless of the system character encoding.

if self._elements is None:
# self.box_options
self._elements = elements_to_expressions(
self,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pyrefly is showing a number of type errors around this section of code. But that can be addressed some other time.


@property
def is_multiline(self) -> bool:
return self.boxes.is_multiline

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think self.boxes should be self.inner_box now.

But again, this is not central to this PR; just something noticed.

@rocky

rocky commented Aug 15, 2026

Copy link
Copy Markdown
Member

LGTM. I'm glad we are starting to address some of the many boxing issues we have.

@mmatera
mmatera merged commit b759de3 into master Aug 16, 2026
18 checks passed
@mmatera
mmatera deleted the MakeBoxes_uses_utf_encoding branch August 16, 2026 21:45
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.

2 participants