Bug Report: OrderSendResult Structure Missing comment Field Content in Python API When Non-UTF-8 Characters Are Present

 

Hi all,

I couldn't find a dedicated bug-reporting channel, so I'm posting here. I'd appreciate any confirmation from the community on this issue, and ideally, someone could escalate it to the development team if confirmed as a bug.

When using the Python API’s order_send() function in MT5, the OrderSendResult structure returned includes a comment field intended to capture the broker’s comment on the operation. However, if the broker's comment contains non-UTF-8 characters, the comment field remains empty in the Python API response, even though the comment displays correctly in the MT5 Terminal.

Steps to Reproduce

  1. Execute a request using order_send() from the Python API, ensuring that the operation generates a comment with non-UTF-8 characters (e.g., by attempting to sell a symbol not present in your wallet).

  2. Check the comment field in the OrderSendResult object returned by order_send() .

Expected Behavior

The comment field in the OrderSendResult should contain the broker's comment, including any non-UTF-8 characters, as displayed in the MT5 Terminal’s Journal tab.

Actual Behavior

The comment field in Python returns an empty string if the broker's comment includes non-UTF-8 characters. The comment, however, is visible in the MT5 Terminal.

Example

Here’s an example when attempting to sell a symbol not in the wallet:

  • True Broker Comment: "A quantidade da ordem é maior"
  • Returned Broker Comment (displayed in MT5 Terminal Journal or MQL5 OrderSendResult structure):  "A quantidade da ordem Ã© maior"
  • Actual Python Result: OrderSendResult.comment returns an empty string.



Additional Context

This issue disrupts applications that rely on broker comments for diagnostics or logging, as key information is inaccessible when non-UTF-8 characters are involved.

Request

Can anyone verify if they experience the same behavior? If so, is there any workaround to access the broker's comment in its intended form via the Python API?

Thank you!