untangled

NEW CHANNEL: #fulcro
2016-07-20T16:19:14.000120Z

I'm dealing with a bug report of UTF-8 characters not showing correctly. Has anybody seen any issues with utf-8 in untangled? Starting to look like it might be because the transit middleware in untangled isn't assigning a default charset of utf-8?

2016-07-20T16:26:06.000121Z

(The £ symbol is fine when pushed over our websocket subscription, but when I refresh the page and it's pulled via /api, suddenly it renders incorrectly)

mahinshaw 2016-07-20T17:06:07.000122Z

@therabidbanana: The transit encoding is definitely different if you are using untangled-websockets. But at the end of the day, websockets uses a lot of the same code. The transit encoding happens in untangled.server.impl.middleware

2016-07-20T17:07:21.000123Z

We're using our own websocket implementation

2016-07-20T17:08:42.000124Z

But I think I've figured out how to reproduce - JVM on our production servers must have locale settings that make it think ASCII is the default if one is not provided.

2016-07-20T17:44:34.000125Z

If we boot the jvm with -Dfile.encoding=utf-8, it works as expected, so probably not a bug, but maybe a potentially dangerous undefined default somewhere in transit encoder setup?

mahinshaw 2016-07-20T17:48:52.000126Z

https://github.com/cognitect/transit-clj/issues/24

mahinshaw 2016-07-20T17:50:09.000128Z

This looks useful. We could change the writer to always write UTF-8. My guess i there is an environment issue with the ByteArrayOutputStream on your system. It could be configureable too.

mahinshaw 2016-07-20T17:50:53.000131Z

Last link is the transit write

mahinshaw 2016-07-20T17:51:46.000132Z

line 11 ret (.toString baos) => ret (.toString baos “UTF-8”)

mahinshaw 2016-07-20T17:52:13.000133Z

It might be worth testing that with checkouts in your environment and seeing it it resolves something

2016-07-20T19:31:55.000134Z

Do we think it's something untangled should enforce? Happy to submit a patch for it if that's the way we wanted to go, but wasn't sure if we want to make that assumption for everyone

mahinshaw 2016-07-20T19:56:55.000135Z

@therabidbanana: It should definitely be configurable, but in the end, fall back to utf-8

2016-07-20T20:13:10.000136Z

Logged as: https://github.com/untangled-web/untangled-server/issues/9

tony.kay 2016-07-20T22:46:50.000138Z

@jasonjckn: on your diff patch. how well tested is that from a cljs perspective? Have you written and run tests in the spec?

tony.kay 2016-07-20T22:47:02.000139Z

@adambros: is out, not sure when he can get to a review

tony.kay 2016-07-20T22:47:37.000140Z

I'd be ok pulling it into develop SNAPSHOT if you're highly confident in it and have actually run it through tests on the clj and cljs sides.