Algo-Web / POData-Laravel

Composer Package to provide Odata functionality to Laravel
MIT License
34 stars 30 forks source link

Check if Database is in UTF8 #208

Closed drkmtrx closed 4 years ago

drkmtrx commented 4 years ago

In primitiveToString() please check if the content is already in utf8 before calling utf8_encode(). When using Postgres data is already in utf8 and this utf8_encode break special characters like umlaut.

c-harris commented 4 years ago

just sorting out a few things with the test setup (you got your own app setup in regression tests) but we can get on this in the near future.

I am thinking about using mb_detect_encoding instead of checking the database, thoughts?

CyberiaResurrection commented 4 years ago

@bgoak , since @c-harris and I have re-arranged the IronicSerialiser somewhat since your initial report, could you supply a string that's being mangled (such as one with an umlaut)?

From your report, that should be passed through unchanged - if not, could you also supply what it should be processed into?

drkmtrx commented 4 years ago

For example a typical german name like Müller, this should be passed unchanged. So when mb_detect_encoding detects a string in utf8 (or ascii) it should just skip the encode.

CyberiaResurrection commented 4 years ago

Sweet, thanks for that. Now to pry some of these hands off my time.

CyberiaResurrection commented 4 years ago

@bgoak , can you try #212 and see if it solves your reported problem?

CyberiaResurrection commented 4 years ago

This issue is simple and well-characterised, so I'm closing it as fixed.