#### Brief overview of PR changes/additions
MXP element attribute values - such as `SEND` link targets/hints and
`<!ENTITY>` values - were always decoded as UTF-8, ignoring the
session's negotiated encoding. On non-UTF-8 games (Latin1, GBK, Big5,
WINDOWS-1251, ...) any non-ASCII bytes in an attribute were mis-decoded,
so MXP links and entities carried garbled text.
This threads the active session encoding into `TMxpNodeBuilder` (set by
`TMxpProcessor` before parsing each character) and decodes attribute
names/values through a new shared `TStringUtils::decodeBytes` helper.
That helper also replaces the duplicated decode logic previously inline
in `TMxpProcessor::decodeRawBytes`, so the attribute path and the raw
tag/content path now interpret bytes identically. An empty
(not-yet-negotiated) encoding continues to be treated as UTF-8,
preserving prior behaviour for default sessions.
#### Motivation for adding to Mudlet
Players on non-English MUDs saw corrupted text in MXP links and custom
entities whenever those carried accented or non-Latin characters - the
attribute parser was the only MXP path still hardcoding UTF-8 while
element content already honoured the session encoding.
#### Other info (issues closed, discussion etc)
Added regression tests:
- `TMxpEntityTagHandlerTest`: quoted and unquoted `<!ENTITY>` values in
a WINDOWS-1251 session decode to "Гроза"; a UTF-8 session still resolves
the same value unchanged.
- `TMxpSendTagHandlerTest`: a `SEND href` with Latin1 bytes decodes to
"señor"; an empty (default) session encoding still decodes attributes as
UTF-8.
The WINDOWS-1251 entity test was verified to fail on the baseline
(producing U+FFFD replacement characters) before the fix. All 14
MXP/encoding/entity unit tests pass.
Assisted-by: Claude:claude-opus-4-8
#### Brief overview of PR changes/additions
Fixes text containing `<` characters being swallowed when connecting to
games that negotiate MXP via telnet but don't actually send MXP content.
The fix validates text against the MXP specification to distinguish real
MXP tags from regular text, preventing false positives when `<` appears
in normal game text.
#### Motivation for adding to Mudlet
Users reported that typing commands like `echo <test` resulted in no
output on certain games (e.g., Merentha). The `<` character was being
interpreted as the start of an MXP tag, causing text to disappear.
#### Other info (issues closed, discussion etc)
Fixes#8899, #8980
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Mudlet was only able to display entities with only one Latin1 character
in normal mud output.
This fix removes this restriction and also enables the use of special
characters represented by MXP default entities.
#### Motivation for adding to Mudlet
Improve MXP compliance
#### Other info (issues closed, discussion etc)
The patch changes small tidbits in several places: TBuffer was not able
to add additional characters to an input line, also the inserted entity
content must be reparsed to see if an MXP element is contained or to
interprete any non-Latin1 encoding while not risking a deadlock by
trying to resolve a recursive entity definition. This also required a
way for the entity resolver if a given entity is custom, default, or
unknown.
There are some screenshots and remarks at the end of
https://forums.mudlet.org/viewtopic.php?f=7&t=23206&start=10 .
Also, you can see how this works by connection to aldebaran-mud.de login
as a guest char (hit y to confirm) then "set mxp test 5", "set mxp test
6" or, for insights: "set mxp test 5 source", "set mxp test 6 source"
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
If a mud creates an MXP entity that is no all lowercase, it cannot be
deleted.
This is because entity names are managed as all lowercase internally...
Except for <!EN ... DELETE> which will fail to find the entity
definition if the name is not all lowercase.
The PR also extends TMxpEntityTagHandlerTest.cpp to check for this
issue.
#### Motivation for adding to Mudlet
Improve MXP compliance by fixing this issue.
#### Other info (issues closed, discussion etc)
I have no real life example for this issue, AFAIK most games don't
delete entities, they just redefine them when needed.
Actually, <B>note</B> that the MXP protocol specifies entities as case
sensitive: <CITE>Also note that as in XML, entities are case
sensitive, so &Start; is different than &start;</CITE>.
Mudlet breaks this requirement. However, entity names are converted to
lower case all over the place in the code. It will be quite painful to
remove this in all places. I also fear that some muds may already rely
on this incompliant behaviour of Mudlet, so it might be better to leave
this as it is. IMHO, a sensible mud developer/coder should really not
use entities which just differ by case.
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Allows to set an entity to the the empty string ("")
#### Motivation for adding to Mudlet
Improve MXP compliance
#### Other info (issues closed, discussion etc)
[MXP enhancements, was PR
#4200](https://forums.mudlet.org/viewtopic.php?f=7&t=23206)
You can immediately see the effect of this when logging into
aldebaran-mud.de port 2000 as a guest.
The mud cannot adjust the MXP prompt properly: Hovering over the ... in
the prompt shows elements
(right click for menu and &PRHI;) the game was unable to set to empty.
The change removes this issue.
---------
Co-authored-by: Vadim Peretokin <vperetokin@hey.com>
<!-- Keep the title short & concise so anyone non-technical can understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Fix for bug on entity tag handling
Tests for MxpEntityTagHandler
#### Motivation for adding to Mudlet
Entities were not correctly registered and thus not interpolated, some menus were not correct in discworld