Hello @Kristian Lamens
Thanks for reaching out to us, it seems like the issue might be related to the encoding of the output text in C#.
I have seen the same error when I working with some non-ASCII characters as well. For non-ASCII characters, it's important to make sure that the text is encoded properly. Persian language uses the Arabic script, which means that the text is written from right to left and contains characters that are not present in the ASCII character set.
In C#, you can use the System.Text.Encoding
class to specify the character encoding for your output. The Encoding
class provides a GetString
method that you can use to convert a byte array into a string, using the specified encoding.
One common encoding for Persian text is UTF-8. You can try specifying UTF-8 encoding when converting your output byte array into a string, like this:
byte[] outputBytes = ... // your output byte array
string outputText = System.Text.Encoding.UTF8.GetString(outputBytes);
If your output still shows ???????
, it's possible that the issue is with the font being used to display the Persian characters. Make sure that you're using a font that supports the Arabic script, such as Microsoft's "Arial Unicode MS" font.
If neither of these solutions works, please provide more details about your code and the specific library or API you're using for the translation, how you process the translation, which Azure product you are using, so that we can understand this issue better.
I hope this helps.
Regards,
Yutong
-Please kindly accept the answer and vote 'Yes' if you feel helpful to support the community, thanks a lot.