Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format 0 must be utf-8 #33

Open
awwright opened this issue Aug 7, 2014 · 6 comments
Open

Format 0 must be utf-8 #33

awwright opened this issue Aug 7, 2014 · 6 comments
Labels
bug RFC 7252 Issues related to RFC 7252 (original CoAP specification)

Comments

@awwright
Copy link

awwright commented Aug 7, 2014

Format 0 is defined as text/plain; charset=utf-8. By definition, text/* defaults to US-ASCII and causes encoding problems if a Unicode-encoded document is served without this charset parameter - e.g. in CoAP-to-HTTP translators.

Instead, the module serves option 0 as merely text/plain i.e. US-ASCII.

@mcollina
Copy link
Collaborator

mcollina commented Aug 7, 2014

Good catch! Would you like to send a PR?

@awwright
Copy link
Author

awwright commented Aug 7, 2014

How would these cases be handled:

res.setOption('Content-Format', 'text/plain');
// vs.
res.setOption('Content-Format', 'text/plain;charset=utf-8');
// vs.
res.setOption('Content-Format', 'text/plain; charset=utf-8'); // whitespace

Is anyone currently using the first when they intend the second/third options?

Should equivalent forms be handled? (I maintain a library to parse these Media type formats, "contenttype")

@mcollina
Copy link
Collaborator

mcollina commented Aug 7, 2014

Anyway, it's a bug. The spec it's clear that's utf-8, and it is how is parsed by node-coap anyway.
Basically, it's just the wrong string.

Pick what version suits you most of the other two.

@stale
Copy link

stale bot commented Jul 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 14, 2020
@stale
Copy link

stale bot commented Jul 21, 2020

This issue has been automatically closed because of inactivity. Please open a new issue if still relevant and make sure to include all relevant details, logs and reproduction steps. Thank you for your contributions.

@stale stale bot closed this as completed Jul 21, 2020
@JKRhb JKRhb added bug and removed wontfix labels Sep 21, 2021
@JKRhb
Copy link
Member

JKRhb commented Sep 21, 2021

Reopening this issue as the bug is still present.

@JKRhb JKRhb reopened this Sep 21, 2021
@JKRhb JKRhb added the RFC 7252 Issues related to RFC 7252 (original CoAP specification) label Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug RFC 7252 Issues related to RFC 7252 (original CoAP specification)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants