Skip to content

Commit d213482

Browse files
committed
Update VBA-JSON to v1.0.3
1 parent 431e7ac commit d213482

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/WebHelpers.bas

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ Private Function web_GetUrlEncodedKeyValue(Key As Variant, Value As Variant) As
17631763
End Function
17641764

17651765
''
1766-
' VBA-JSON v1.0.2
1766+
' VBA-JSON v1.0.3
17671767
' (c) Tim Hall - https://github.com/VBA-tools/VBA-JSON
17681768
'
17691769
' JSON Converter for VBA
@@ -2190,6 +2190,13 @@ Private Function json_Encode(ByVal json_Text As Variant) As String
21902190
For json_Index = 1 To VBA.Len(json_Text)
21912191
json_Char = VBA.Mid$(json_Text, json_Index, 1)
21922192
json_AscCode = VBA.AscW(json_Char)
2193+
2194+
' When AscW returns a negative number, it returns the twos complement form of that number.
2195+
' To convert the twos complement notation into normal binary notation, add 0xFFF to the return result.
2196+
' https://support.microsoft.com/en-us/kb/272138
2197+
If json_AscCode < 0 Then
2198+
json_AscCode = json_AscCode + 65536
2199+
End If
21932200

21942201
Select Case json_AscCode
21952202
' " -> 34 -> \"

0 commit comments

Comments
 (0)