Hi,
I am using the RingCentral API to send faxes. The confirmation email that is sent via email does not contain a valid filename, but instead, shows some weird characters, as shown below:
I am using the .NET SDK as shown below:
Is this a bug with the API?
Thank you in advance!
What is the name of the file that it should be displayed? And did you send from a production or a sandbox account?
I just run a quick test and the file name displayed correctly.
In this case it was a client uploading a file so I do not know the exact name, but it is using the FileInfo.Name property, which will never be base64 encoded like this.
This happens in production.
The issue can be reproduced with the official app. Just send a fax with a file with Chinese characters in the filename, such as [some-chinese-characters-here].txt. (this forum doesn't support Chinese characters, if I include some, the post cannot be published at all.)
The email notification will display the filename as %E6%B5%8B%E8%AF%95.txt
I believe it is a bug of the program which sends out the email notification. It cannot handle non-ascii characters.
I can now confirm that if the name of a file is in unicode, the filename will not be rendered correctly in the fax transmission result email. There seems no solution for this. So the only way to avoid that problem is to change the name to something else not in unicode chars.
Thank you for your response, I had a feeling this was a bug.
Are there any workarounds? The .NET SDK uses a string for the filename, and not a byte array, which is always natively Unicode, I believe.
I can try to hack something like this together, but not sure it will work:
new string(Encoding.UTF8.GetBytes(file.Name).Select(b => (char)b).ToArray())
In fact, I tried this but it did not fix the problem at all. It looks the same so I guess that the system converts unicode to UTF-8 string too.
private string UnicodeToUTF8(string strFrom) { byte[] bytes = System.Text.Encoding.Default.GetBytes(strFrom); return System.Text.Encoding.UTF8.GetString(bytes); }
I don't think your solution would work either.
Exactly what I thought. What can we do to correct this issue then?
One interesting thing I just found out is that when I send a fax using Node JS code, a unicode file name is displayed correctly on the email.
As I wrote, I could not find any solution except avoid using unicode file name, or detect if the filename is in unicode then use a default ASCII string name.
I understand, but, as shown above, this cannot be done in the C# SDK, and I cannot see any workarounds; seems like this issue will need to be corrected at the source, unless you can explain to me what to do in the SDK to correct the issue.
Thank you!
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder