bdw429s
10/11/2024, 8:14 PMchr(0)
I'm building out a STOMP broker in CF (which terminates each message with a null byte) and this worked as I expected in Boxlang, but I can see from Lucee's source code, 0
is a special case, hard-coded to return an empty string instead of a null byte, which is not the same thing!bdw429s
10/11/2024, 8:14 PMURLDecode( "%00" )
dswitzer
10/11/2024, 9:34 PMnull
, so they treated the null byte the same way they do null
in a database.bdw429s
10/11/2024, 9:36 PMbdw429s
10/11/2024, 9:37 PMbdw429s
10/11/2024, 9:37 PMbkbk
10/13/2024, 11:57 AM<cfset chr0=chr(0)>
<cfset nullByte1=URLDecode("%00","utf-8")>
<cfset nullByte2=charsetEncode( javacast("byte[]", [0] ), "utf-8")>
<cfoutput>
len(chr0): #len(chr0)# <br>
len(nullByte1): #len(nullByte1)# <br>
len(nullByte2): #len(nullByte2)# <br><br>
chr0 is nullByte1: #chr0 is nullByte1# <br>
chr0 is nullByte2: #chr0 is nullByte2# <br>
nullByte1 is nullByte2: #nullByte1 is nullByte2#
</cfoutput>
results in
len(chr0): 0
len(nullByte1): 1
len(nullByte2): 1
chr0 is nullByte1: NO
chr0 is nullByte2: NO
nullByte1 is nullByte2: YES
bdw429s
10/14/2024, 5:25 PMcharsetEncode( javacast("byte[]", [0] ), "utf-8")>
method of creating a null bytebdw429s
10/14/2024, 5:25 PMbdw429s
10/14/2024, 5:26 PMbdw429s
10/14/2024, 5:30 PMcharsetEncode()
BIF 🙂Mark Takata (Adobe)
10/16/2024, 8:36 PMnimitsharma
10/18/2024, 4:56 AMbdw429s
10/18/2024, 3:17 PMbkbk
10/20/2024, 11:04 AM