I have this function:
Private Sub CheckParams(Values) Dim Str, Ch If IsArray(Values) then Str = Join(Values, "") Else Str = Values End If For I = 1 To Len(Str) Ch = Asc(Mid(Str, I, 1)) If Not ((Ch = 9) Or (Ch = 10) Or (Ch = 13) Or ((Ch > 31) And (Ch < 128))) Then SetError("script result contains illegal characters.") End If Next End Sub
This function throws an error if the input value has characters that are not in the list, according to the If statement in the For loop. The problem is that when my input value has Japanese characters, validation is passed without errors. I think the Asc () function, which is used to return the character's ANSI code, does not know how to handle Japanese characters.
What is apparently the problem?
Does Asc () function return negative numbers?
source share