Change URI encoding method from encode to encodeURIComponent

Change URI encoding method from encode to encodeURIComponent
Because encode method can not encode multibyte strings to URI format