Discussion:
set charset on http server
David Smith
2015-02-03 19:01:39 UTC
Permalink
I want to set the charset for responses from my aleph server but I can't
see how to do this. I can see the charset is set to UTF-8
at https://github.com/ztellman/aleph/blob/0104c33c28ba4e16d91dddb469a0f9f6974ffc20/src/aleph/netty.clj#L97
but is there anyway I can change this?
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Zach Tellman
2015-02-03 20:01:24 UTC
Permalink
You could turn the strings into bytes yourself with your preferred
encoding. The assumption was that if you haven't done that already, you're
largely encoding agnostic. Can you expand on your use case?
Post by David Smith
I want to set the charset for responses from my aleph server but I can't
see how to do this. I can see the charset is set to UTF-8 at
https://github.com/ztellman/aleph/blob/0104c33c28ba4e16d91dddb469a0f9f6974ffc20/src/aleph/netty.clj#L97
but is there anyway I can change this?
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
David Smith
2015-02-04 08:09:17 UTC
Permalink
I am writing a crawler and in my tests I have an http server that I want to
send any response that I can think of that may be difficult for the
crawler. Obviously encoding is one of the first things I need to get right.

So can I put a byte array directly in the :body of the response? That
would be perfect.
Post by Zach Tellman
You could turn the strings into bytes yourself with your preferred
encoding. The assumption was that if you haven't done that already, you're
largely encoding agnostic. Can you expand on your use case?
Post by David Smith
I want to set the charset for responses from my aleph server but I can't
see how to do this. I can see the charset is set to UTF-8 at
https://github.com/ztellman/aleph/blob/0104c33c28ba4e16d91dddb469a0f9f6974ffc20/src/aleph/netty.clj#L97
but is there anyway I can change this?
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Zach Tellman
2015-02-04 08:10:01 UTC
Permalink
Anything which can be coerced to bytes via the byte-streams conversion
graph is a valid body.
Post by David Smith
I am writing a crawler and in my tests I have an http server that I want
to send any response that I can think of that may be difficult for the
crawler. Obviously encoding is one of the first things I need to get right.
So can I put a byte array directly in the :body of the response? That
would be perfect.
Post by Zach Tellman
You could turn the strings into bytes yourself with your preferred
encoding. The assumption was that if you haven't done that already, you're
largely encoding agnostic. Can you expand on your use case?
Post by David Smith
I want to set the charset for responses from my aleph server but I can't
see how to do this. I can see the charset is set to UTF-8 at
https://github.com/ztellman/aleph/blob/0104c33c28ba4e16d91dddb469a0f9
f6974ffc20/src/aleph/netty.clj#L97 but is there anyway I can change
this?
--
You received this message because you are subscribed to the Google
Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...