Sokolee / aspjson

Automatically exported from code.google.com/p/aspjson
0 stars 0 forks source link

encouter error while encode some chinese to json #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
<!--#include file="JSON_2.0.3.asp"-->
Response.Write toJSON("数量")

the code above will encounter an error info:

Microsoft VBScript 运行时错误 错误 '800a0009'

下标越界: 'charcode'

/report/JSON_2.0.3.asp,行 87 

---------which means
microsoft vbscript runtime error error no '800a0009'

out of bound 'charcode'

/report/JSON_2.0.3.asp,line 87 

-----------
and i also test other chinese characters,some just works fine, the other
meet the same error .

Original issue reported on code.google.com by tunpishu...@gmail.com on 10 Jan 2010 at 4:17

GoogleCodeExporter commented 8 years ago
i've modified line 87 of JSON_2.0.3.asp to :

charcode=clng("&h" & hex((ascW(haystack(i)))))

and it works fine for all chinese characters.

Original comment by tunpishu...@gmail.com on 10 Jan 2010 at 5:16

GoogleCodeExporter commented 8 years ago

Original comment by tugrulto...@gmail.com on 10 Jan 2010 at 12:20

GoogleCodeExporter commented 8 years ago
in the SVN

charcode = AscW(haystack(i)) And 65535

Original comment by tugrulto...@gmail.com on 10 Jan 2010 at 3:24

GoogleCodeExporter commented 8 years ago
Issue 16 has been merged into this issue.

Original comment by tugrulto...@gmail.com on 6 Mar 2010 at 3:43