llde / xOBSE

Oblivion Script extender source
247 stars 35 forks source link

Fix an issue with SetMenuStringValue / MessageBoxEX / TextInputMessageBox #133

Closed kuroko137 closed 2 years ago

kuroko137 commented 2 years ago

These functions have an issue where a string will be separated at an unexpected position if it contains multibyte characters with the same charactor code as SeparatorChar. The following is an example in the Japanized version Oblivion (Shift JIS):

この''を取りますか? (Do you want to take this bow?) ↓ この' 'を取りますか?

In this example, the string is separated at an unexpected position because the character code for (bow) is 0x8b7c, which contains "7c", the character code for SeparatorChar (|).

kuroko137 commented 2 years ago

Thanks for the review and the better solution! I've rewritten my previous code.

llde commented 2 years ago

Thanks for the contribution. Hoping won't break anything.