401 error when sending French or Polish characters to Data Collector API

%3CLINGO-SUB%20id%3D%22lingo-sub-173574%22%20slang%3D%22en-US%22%3E401%20error%20when%20sending%20French%20or%20Polish%20characters%20to%20Data%20Collector%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-173574%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20have%20a%20solution%20that%20sends%20custom%20data%20to%20Log%20Analytics%20via%20the%20Data%20Collector%20API.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20challenge%20is%20that%20the%20moment%20we%20try%20to%20send%20data%20that%20contains%20a%20national%20character%20like%20(French%20or%20Polish)%2C%20so%20anything%20outside%20of%20standard%20ASCII%20range%2C%20we%20get%20401%20error.%20It%20looks%20like%20authorization%20error%2C%20but%20the%20moment%20we%20remove%20problematic%20national%20character%20from%20the%20data%2C%20it%20works%20perfectly.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIs%20there%20anything%20we%20can%20do%20about%20this%2C%20apart%20from%20encoding%20special%20characters%20in%20ASCII%20chars%20only%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EKind%20regards%3C%2FP%3E%0A%3CP%3ETomasz%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-173574%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1049217%22%20slang%3D%22en-US%22%3ERe%3A%20401%20error%20when%20sending%20French%20or%20Polish%20characters%20to%20Data%20Collector%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1049217%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F115098%22%20target%3D%22_blank%22%3E%40Tomasz%20Luchowski%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20the%20exact%20same%20problem.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EEspana%20-%26gt%3B%20added%20to%20logs%20just%20fine%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EEspa%C3%B1a%20-%26gt%3B%20doesn't%20work%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EResponse%3A%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EHTTP%2F1.1%20403%20Forbidden%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E...%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%22Error%22%3A%22InvalidAuthorization%22%2C%22Message%22%3A%22An%20invalid%20signature%20was%20specified%20in%20the%20Authorization%20header%22%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EDefault%20application%2Fjson%20encoding%20is%20UTF-8%20so%20I%20expect%20this%20to%20work.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ESpecifying%20the%20content-type%20of%20the%20request%20as%26nbsp%3BContent-Type%3A%20application%2Fjson%3B%20charset%3Dutf-8%2C%20instead%20of%20just%20application%2Fjson%20does%20not%20fix%20the%20issue%20either%20(to%20be%20clear%3A%20it%20should%20not%2C%20since%20it%20should%20work%20already!).%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EAny%20solution%20to%20this%20would%20be%20greatly%20appreciated.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EKind%20regards%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EGert%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello,

 

We have a solution that sends custom data to Log Analytics via the Data Collector API.

 

The challenge is that the moment we try to send data that contains a national character like (French or Polish), so anything outside of standard ASCII range, we get 401 error. It looks like authorization error, but the moment we remove problematic national character from the data, it works perfectly.

 

Is there anything we can do about this, apart from encoding special characters in ASCII chars only?

 

Kind regards

Tomasz

1 Reply

@Tomasz Luchowski 

 

I have the exact same problem.

 

Espana -> added to logs just fine
España -> doesn't work
 
Response:
 
HTTP/1.1 403 Forbidden
...
{"Error":"InvalidAuthorization","Message":"An invalid signature was specified in the Authorization header"}
 
Default application/json encoding is UTF-8 so I expect this to work.
 
Specifying the content-type of the request as Content-Type: application/json; charset=utf-8, instead of just application/json does not fix the issue either (to be clear: it should not, since it should work already!).
 
Any solution to this would be greatly appreciated.
 
Kind regards,
 
Gert