0

For example, I have an enum object FruitEnum.FRUIT:

enum class FruitEnum {
    @JsonProperty("fruit") FRUIT
}

which I want to pass as query parameter in my request:

@GET("fruit_request")
fun fruitRequest(
        @Query("fruit_param") fruitParam: FruitEnum 
): Single<FruitResponse>

If I switch to turkish language on my phone letter i from @JsonProperty("fruit") will be serialized as %C4%B1, which is, as far as I know, percent encoding for URIs of turkish letter ı (dotless i). However, I still need it to be just fruit instead of fru%C4%B1t. What can I do about it?

oleg.v
  • 1,065
  • 3
  • 11
  • 20
  • So, you need to replace Turkish letters with English ones. But I can't see why on earth you may need this. – Miha_x64 Feb 14 '18 at 15:28
  • No, actually what is happening is that when turkish language enabled english letter `i` gets automatically replaced (I don't want this) with turkish dotless i, then it is getting converted to `%C4%B1` somewhere on Retrofit's or OkHTTP's side. I don't understand this because I specified latin word `fruit` in `@JsonProperty("fruit")` without any turkish letters. – oleg.v Feb 15 '18 at 17:36
  • Your `furit_param`'s value contains non-latin characters inputted by user. They are prohibited by HTTP, so it's absolutely normal that they are being encoded. Every web-server/web-framework handling requests on the other side will decode them back. – Miha_x64 Feb 15 '18 at 20:01

0 Answers0