OSLC API and character encoding
Hi,
I'm having some issues with importing artifacts from a spreadsheet using the OSLC API when "special" characters are in use. The standard DOORS Next import works fine, so I know this should work.
The character codes are 0x02F5 and 0x02F6 which represent MODIFIER LETTER MIDDLE DOUBLE GRAVE ACCENT and MODIFIER LETTER MIDDLE DOUBLE ACUTE ACCENT.
When these characters are present DOORS Next returns a forbidden error to the call.
Do I need to do special character encoding i.e ˵ for these characters?
Thanks,
Andy
Accepted answer
I tried pasting smart quotes “hello” from Word into a DN artifact. When I get the RDF for that artifact using REST API, it appears as “hello” - I observe that the RDF doesn't specify an encoding so I assume the default would be UTF-8
So maybe you need to encode these unicode characters like that?
Comments
2 other answers
Are you specifying the character set in your PUT or POST
Content-Type
header?
For example:
Content-Type=text/turle; charset=utf-8
Comments
I'm having some issues with importing artifacts from a spreadsheet using the OSLC API when "special" characters are in use. The standard DOORS Next import works fine, so I know this should work.
This would assume that the DOORS import uses OSLC, which is very certainly not the case. Even if it was using it does not mean that it would not have to encode data in certain cases.
Yes, you have to use encoding where this is required to adhere to the standards.
In OSLC, the URI, headers and body must be valid by the various standards. This might differ if you use rdf+xml or json. In XML characters like > or < are an issue for example.
Look into those standards to find out which characters are allowed and how to encode others. Look into the OSLC standard documents and the fundamental standards for HTML etc. for the URI's and headers.