Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
asp 修改乱码问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yancend committed Dec 24, 2013
1 parent ddc9868 commit e0bc698
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions asp/Uploader.Class.asp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Class Uploader
cfgSavePath = "upload/"
Set stateString = Server.CreateObject("Scripting.Dictionary")
stateString.Add "SIZE_LIMIT_EXCCEED", "文件大小超过服务器限制"
stateString.Add "TYPE_NOW_ALLOW", "文件类型不允许"
stateString.Add "SIZE_LIMIT_EXCCEED", "File size exceeded!"
stateString.Add "TYPE_NOW_ALLOW", "File type not allowed!"
End Sub
Public Property Let MaxSize(ByVal size)
Expand Down Expand Up @@ -202,7 +202,7 @@ Class Uploader
Private Function GetSaveName( ByVal filename )
Dim format, ext, name
If rsFormValues <> Null Then
If Not IsEmpty( rsFormValues ) Then
format = rsFormValues.Item( "fileNameFormat" )
Else
format = "{yyyy}{mm}{dd}{hh}{ii}{ss}{rand:6}"
Expand Down
10 changes: 9 additions & 1 deletion asp/json.asp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,15 @@ Class jsCore
haystack(i) = Mid(str, i + 1, 1)
charcode = AscW(haystack(i)) And 65535
If charcode < 127 Then
If Not IsEmpty(charmap(charcode)) Then
haystack(i) = charmap(charcode)
ElseIf charcode < 32 Then
haystack(i) = "\u" & Right("000" & Hex(charcode), 4)
End If
Else
haystack(i) = "\u" & Right("000" & Hex(charcode), 4)
End If
Next
jsEncode = Join(haystack, "")
Expand Down

0 comments on commit e0bc698

Please sign in to comment.