Reply
Highlighted
Member
Posts: 3
Registered: ‎07-10-2010

AIM in C# - Encoding International Characters/Symbols

Hello! We've been using the AIM method without issue for years, but recently started getting quite a few European customers. We've noticed that any orders with special characters, such as umlauts and accents, are being rejected. I found an old thread on these forums stating that Authorize.Net doesn't currently support unicode and it suggested using an expanded western encoding. I am writing to see if:

 

1. Is this still the case?

 

2. I'm developing in C# - can anyone tell me what encoding/function to use? I'm using a very similar setup to the sample code where I populate a bunch of entries in a hash and then write it out to a string and I'm assuming I would encode the customer supplied fields in this new encoding as they are put into the hash?

 

Thank you for any help you can provide!

Highlighted
Administrator Administrator
Administrator
Posts: 563
Registered: ‎08-03-2011

Re: AIM in C# - Encoding International Characters/Symbols

Hi jncueto,

 

Although we are currently working to fully support UTF8 as we begin expanding outside of the United States, we have not yet updated every component in our system and you may still see some unexpected behavior using characters outside of the ISO-8859-1 character set.  Hopefully this is a limitation that we will be able to fully remove over the coming months.

 

Thanks,
Joy

Highlighted
Contributor
Posts: 17
Registered: ‎10-03-2013

Re: AIM in C# - Encoding International Characters/Symbols

Can't help you with C# but I'm sure they have something similar to how you would do it in Java:

 

import java.nio.charset.Charset;

import java.nio.charset.CharsetEncoder;

 

final CharsetEncoder encoder = Charset.forName("ISO-8859-1").newEncoder();

if (encoder.canEncode(input)) ...

Highlighted
Member
Posts: 8
Registered: ‎10-04-2012

Re: AIM in C# - Encoding International Characters/Symbols

Can anyone follow-up on this thread. It seems that there is a full support for UTF-8 now, we can infer it from the SDKs, but I cannot find any explicit statement on the AIM documentation about this. How comes that we do not need to specify the charset in some variables?   

Highlighted
Member
Posts: 8
Registered: ‎10-04-2012

Re: AIM in C# - Encoding International Characters/Symbols

OK I tested their system.  From my test, I see that, for onetime AIM payments, they guess the charset. I don't know what is their detect order, but it seems that UTF-8 is their first guess. If it is a valid UTF-8 byte sequence, they assume it is UTF-8. If it is not a valid UTF-8 byte sequence, then they try another charset. In my test, I entered a fake name "G®ou" in ISO latin-1. Since it has the same byte sequence as "G®ou" in UTF-8, they incorrectly assumed it was "G®ou" (without the Â .) So, it is safer to use UTF-8 than to use ISO latin-1.     I also tested "Éric"  in ISO latin-1. In this case, it does not have a valid UTF-8 byte sequence. So, they correctly used ISO latin-1, which is perhaps their second guess.   

Highlighted
Member
Posts: 1
Registered: ‎08-22-2019

Re: AIM in C# - Encoding International Characters/Symbols

This could either be achieved by giving the field a type with the required size (would work out of the box in most places), or e.g. through a custom attribute that marks this as a UTF8 strin.

buy research paper