News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Fax confirmation via email showing base64 characters
Tags: rest api, fax
Mar 20, 2023 at 6:03pm   •   3 replies  •  0 likes
MEDICAL CANNABIS PRIME

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:


1679360311852.png


I am using the .NET SDK as shown below:


1679360548207.png

1679360576498.png


Is this a bug with the API?

Thank you in advance!


on Mar 21, 2023 at 7:35am   •  0 likes

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.

on Mar 21, 2023 at 5:53pm   •  0 likes

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.

2 Answers
answered on Apr 25, 2023 at 12:11pm  

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.



 0
answered on Mar 21, 2023 at 9:08pm  

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.


 0
on Mar 22, 2023 at 6:26am   •  0 likes

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())
on Mar 22, 2023 at 7:45am   •  0 likes

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.

on Mar 22, 2023 at 4:06pm   •  0 likes

Exactly what I thought. What can we do to correct this issue then?

on Mar 23, 2023 at 8:27am   •  0 likes

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.

on Mar 23, 2023 at 7:28am   •  0 likes

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.

on Mar 23, 2023 at 6:41pm   •  0 likes

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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us