json encode function change for utf8

I have rewritten some code, because a commit log of Japanese can not be displayed correctly that it is the original source,