OLINGO-853: correcting the encoding behavior as I reverted the change in EdmString from OLINGO-854, this will also localize the change to this perticular method

This commit is contained in:
Ramesh Reddy 2016-01-22 11:45:06 -06:00
parent 322085df6b
commit b9512eda4b
1 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpStatusCode; import org.apache.olingo.commons.api.http.HttpStatusCode;
import org.apache.olingo.commons.core.Encoder;
import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
import org.apache.olingo.commons.core.edm.primitivetype.EdmString; import org.apache.olingo.commons.core.edm.primitivetype.EdmString;
import org.apache.olingo.server.api.ODataApplicationException; import org.apache.olingo.server.api.ODataApplicationException;
@ -199,7 +200,7 @@ public class EntityResponse extends ServiceResponse {
String value = EdmPrimitiveTypeFactory.getInstance(kind).valueToString( String value = EdmPrimitiveTypeFactory.getInstance(kind).valueToString(
propertyValue, true, 4000, 0, 0, true); propertyValue, true, 4000, 0, 0, true);
if (kind == EdmPrimitiveTypeKind.String) { if (kind == EdmPrimitiveTypeKind.String) {
value = EdmString.getInstance().toUriLiteral(value); value = EdmString.getInstance().toUriLiteral(Encoder.encode(value));
} }
location.append(value); location.append(value);
} }