arturobernalg commented on code in PR #416:
URL: 
https://github.com/apache/httpcomponents-core/pull/416#discussion_r1298663023


##########
httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/SessionOutputBufferImpl.java:
##########
@@ -171,12 +171,26 @@ public void writeLine(final CharArrayBuffer lineBuffer) 
throws CharacterCodingEx
                     final int off = buffer().position();
                     final int arrayOffset = buffer().arrayOffset();
                     for (int i = 0; i < len; i++) {
-                        b[arrayOffset + off + i]  = (byte) 
lineBuffer.charAt(i);
+                        final int c = lineBuffer.charAt(i);
+                        if ((c >= 0x20 && c <= 0x7E) || // Visible ASCII

Review Comment:
   Is it just me, or does this seem duplicated? Perhaps we can move this to a 
`LangUtils` class or somewhere similar to avoid repetition? I've noticed it's 
used both here and in `ByteArrayBuffer`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to