Skip to content
Permalink
Browse files

[frmChat] Make AddQ not reject Unicode characters larger than U+00FF.

Scripts should now be able to send any Unicode using functions such as ChrW() to create such strings with "Use UTF-8 in Chat" enabled. With that disabled, the bot will either send "?" (U+003F) or drop the message.
  • Loading branch information...
nmbook committed Oct 28, 2017
1 parent 49fdc48 commit 4b4e8ec81f2513bfa6f4046c2e003380ac503747
Showing with 4 additions and 4 deletions.
  1. +4 −4 trunk/frmChat.frm
@@ -6909,7 +6909,7 @@ Function AddQ(ByVal Message As String, Optional msg_priority As Integer = -1, Op

' check for invalid characters in the message
For i = 1 To Len(strTmp)
currChar = Asc(Mid$(strTmp, i, 1))
currChar = AscW(Mid$(strTmp, i, 1))

If (currChar < 32) Then
Exit Function
@@ -6920,10 +6920,10 @@ Function AddQ(ByVal Message As String, Optional msg_priority As Integer = -1, Op
If (StrComp(Left$(strTmp, 1), "/", vbBinaryCompare) = 0) Then
' if so, we have extra work to do
For i = 2 To Len(strTmp)
currChar = Asc(Mid$(strTmp, i, 1))
currChar = AscW(Mid$(strTmp, i, 1))

' find the first non-space after the /
If (Not currChar = Asc(Space(1))) Then
If (currChar <> 32) Then
Exit For
End If
Next i
@@ -6934,7 +6934,7 @@ Function AddQ(ByVal Message As String, Optional msg_priority As Integer = -1, Op
End If

' Find the next instance of a space (the end of the command word)
Index = InStr(1, strTmp, Space(1), vbBinaryCompare)
Index = InStr(1, strTmp, Space$(1), vbBinaryCompare)

' is it a valid command word?
If (Index > 2) Then

0 comments on commit 4b4e8ec

Please sign in to comment.
You can’t perform that action at this time.