Open Vixxd opened 8 years ago
EDIT: After MORE further research, the same problem happens in IE:
SyntaxError The string did not match the expected pattern. (Legacy code value: 12 and legacy constant name: SYNTAX_ERR)
I am going to just try to parse the form data into a JSON-friendly format without UTF-8 characters. If there is still a way to use restangular to handle UTF-8 chars nicely via HTTP POST headerse please let me know
Original Post: Urg, from doing more searching it would appear Chrome throws up this error when submitting Unicode values greater than (U+00FF) (ÿ): https://bugs.chromium.org/p/chromium/issues/detail?id=319694#c12 but the unicode char in question: http://www.fileformat.info/info/unicode/char/21B5/index.htm (U+21B5) (↵).
Alternatively, is there any way to use Restangular to still POST but without having the data explicitly in the HTTP header for server-side parsing? Or would wrapping my form fields in a 'data' object still cause the same problem?
As submitting form data with line breaks should be so seemingly common, is there a way to do this with \n rather than ↵? Or will that again cause the same issue as that seems to be why this SO post (also referenced above) was made in the first place?
Were you able to fix this problem? It seems like you were going to try a workaround. Did that work?
Hi there,
I am trying to submit a form with a multi-line text area, using my service as follows:
baseSites.customPUT(site, site.name);
I am using a Request Interceptor for token authorisation as follows:
At the line "Headers currently are," the following is printed:
The form is submitted with no issue when there are no line returns. When there are line returns (↵↵), or certain (?) UTF-8 chars for that matter, I get the following error:
From searching I see other people who get this error are often using non-English or other UTF-8 characters, but:
I am not sure how to do this with Restangular, or if that will actually help.
Also setting the headers to have any variant of the following does not appear to help:
Content-type: application/json; charset=utf-8
Accept: application/json Accept-Charset: utf-8
Accept: application/json;charset=utf-8
Any help would be appreciated, thanks.
Versions:
Chome Version 49.0.2623.87 m