I use feign to make request to another microservice with pageable and my custom encoder to manage sorting/paging;
@GetMapping(
value = {"/add-ben"},
produces = {"application/json"}
)
BaseResponse<MyPageImpl<AddBenDTO>> getAddBenDTOList(@SpringQueryMap RequestGetAddBen request, Pageable pageable);
I am using below JSON to use pageable;
{
"offset": 0,
"sort": "name,DESC",
"unpaged": true,
"paged": true,
"pageNumber": 0,
"pageSize": 0
}
After the response accepted, I saw that the 'name' values are sorted into DESCENDING order with using "Turkish" characters at first (not starting from Z, but with turkish characters such as İ,Ü,Ş is at the beginning);
{
"data": {
"content": [
{
(...)
"name": "İSDEMİR ADDBEN TANIMI",
},
{
(...)
"name": "ÜCRETSİZ HAYAT SİGORTA"
},
{
(...)
"name": "ZUNICO _ADD BEN"
},
{
(...)
"name": "TPATVAKF_ FON",
},
{
(...)
"name": "PROMET END.VE TİC.LAST."
},
{
(...)
"name": "OYAK RENAULT OTOMOBİL FABRİKALARI A.Ş."
}
], (...)
}
I think, this is related with the default charset. According to feign doc. UTF-8 is the default charset.
How can I correct the sorting with correct order including Turkish characters also?
Thanks