Opened 4 years ago

Closed 4 years ago

#4163 closed defect (wontfix)

rails/postgres error when sending message with special character

Reported by: woodpeck Owned by: rails-dev@…
Priority: minor Milestone:
Component: website Version:
Keywords: Cc:


I am relaying this message from the German forum:

Someone tried to send a message through user-to-user-messaging and got a strange "PGError: ERROR: invalid byte sequence for encoding "UTF8": 0xfc" message. 0xfc is ISO-8859-1 for a common German special character (ü). I can send messages containing that letter with no problem. I suspect that for some reason if a browser doesn't send UTF-8 but ISO-8859-1 then it breaks. No idea if this is the browser's or server's fault though!

I recommended not using special characters as a workaround.

Change History (3)

comment:1 Changed 4 years ago by TomH

This is a tricky area as there is no way to tell what encoding a browser has used for the form data it sends, or to tell it to use a particular encoding.

There are various things you can do to try and persuade the major browsers to send data as UTF-8 but nothing that is 100% guaranteed to work everywhere.

comment:2 Changed 4 years ago by TomH

I think we're probably doing everything we can here to be honest - we (well rails anyway) are setting accept-charset="UTF-8" on the form and adding a hidden field with a UTF-8 encoded value.

Both of those are things which will persuade some browsers to return form data as UTF-8 but obviously not all browsers...

Could you find out what browser the user reporting the problem was using?

comment:3 Changed 4 years ago by TomH

  • Resolution set to wontfix
  • Status changed from new to closed

I'm closing this given that's it not clear there is anything we can do, and we have no idea what browser triggered the problem.

Note: See TracTickets for help on using tickets.