I'm mobile so can't confirm, but utf-8 has multi-byte characters as well. > On Jan 20, 2016, at 9:32 PM, Gary Gregory <[email protected]> wrote: > >> On Wed, Jan 20, 2016 at 6:18 PM, Blake Day <[email protected]> wrote: >> >> I'm not sure on that, but it wouldn't fix the erroneous byte count on log >> messages with a multi-byte unicode character. > > Please see my latest message. > > "multi-byte unicode character." Doesn't the spec call for UTF-8 as the only > encoding? > > Gary > > >>>> On Jan 20, 2016, at 9:04 PM, Gary Gregory <[email protected]> >>> wrote: >>> >>> Hm, shouldn't we be using UTF-8 instead of Charset.defaultCharset() in: >>> >>> public byte[] getBytes() { >>> final String frame = toString(); >>> return frame.getBytes(Charset.defaultCharset()); >>> } >>> >>> ? >>> >>> Gary >>> >>>> On Wed, Jan 20, 2016 at 4:58 PM, Blake Day <[email protected]> wrote: >>>> >>>> TlsSyslogFrame appears to be miscalculating the message length. >> According >>>> to RFC5425, the message length must be the octet count of the >> SYSLOG-MSG in >>>> the frame. Though the variable below is aptly named >> messageLengthInBytes, >>>> it is assigned the value from message.length() (where message is a >> String) >>>> rather than the bytes. >>>> >>>> See below for relevant portions of code: >>>> >>>> private String message; >>>> private int messageLengthInBytes; >>>> >>>> private void setLengthInBytes() { >>>> messageLengthInBytes = message.length(); >>>> } >>>> >>>> @Override >>>> public String toString() { >>>> final String length = Integer.toString(messageLengthInBytes); >>>> return length + Chars.SPACE + message; >>>> } >>>> >>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [email protected] >>>> For additional commands, e-mail: [email protected] >>> >>> >>> -- >>> E-Mail: [email protected] | [email protected] >>> Java Persistence with Hibernate, Second Edition >>> <http://www.manning.com/bauer3/> >>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> >>> Spring Batch in Action <http://www.manning.com/templier/> >>> Blog: http://garygregory.wordpress.com >>> Home: http://garygregory.com/ >>> Tweet! http://twitter.com/GaryGregory >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] > > > -- > E-Mail: [email protected] | [email protected] > Java Persistence with Hibernate, Second Edition > <http://www.manning.com/bauer3/> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> > Spring Batch in Action <http://www.manning.com/templier/> > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
