Invalid UTF-8

daniela forero5 years ago

Hi, I am using the traccar php SDK to use the API but I have the following error when registering a user with special characters.

{"responseCode":400,"error":"","response":"Invalid UTF-8 middle byte 0x20\n at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 9] (through reference chain: org.traccar.model.User[\"name\"])"}

I am using the following command:

$this->curl('/api/users','POST',$cookie,$data,array("Content-Type: application/json"));

I have looked for how to solve it but I have not succeeded, could you guide me on this error?

Thanks a lot

Anton Tananaev5 years ago

Seems like you are sending incorrectly encoded data.

daniela forero5 years ago

I have no problems with data like "jose" but when I send "josé" is when I have the problem.

Where could I configure the charset to UTF-8?