netty/netty — Issue #82: Add A Way To Validate Charsets Using Channel Buffers
Author: garethcollins
Created: 2011-11-25 03:56:55+00:00
State: open

Initial discussion for this request is here:

http://groups.google.com/group/netty/browse_thread/thread/55e267a48aedb2ab#

Basically, it would be nice if ChannelBuffers could (somehow) validate that received messages are compliant with a specified Charset (at least UTF-8).

This would be useful for text based protocols or protocols which have text based frames (such as web sockets :)).
Currently the only way to do the validation is to actually do the String/CharBuffer conversion (which requires a copy). It seems to be a fit for the ChannelBuffers as I assume a goal of ChannelBuffers is to minimize memory copies.

It would be nice if this could work with a dynamic buffer, verifying that the data is compliant with a specified charset as new data is added...and allowing for partial characters at the end of the buffer (assuming there would be additional data entered to complete any partial character).