스카리아풀빌라

prototype.js 한글문제

IT
prototype.js 한글문제 때문에 검색해서 찾은 결과입니다.
아래는 http://haroc.haroc.net/tc/304 에서 복사해서 가지고 온 글입니다.

===============================================================================

Scriptaculous를 사용하기 위해 prototype.js v 1.6.0.1을 사용하게 되었다.

그런데 한글로 QueryString을 보내면 한글문제가 발생하는 것이다.

다양한 삽질끝에.. 발견한것..


return key + '=' + encodeURIComponent(String.interpret(value));
를 아래로 대체
return key + '=' + String.interpret(value);

var key = encodeURIComponent(pair.key), values = pair.value;
를 아래로 대체
var key = pair.key, values = pair.value;

위의 두개에서 encodeURIComponent()를 빼고 하였더니 문제없이 한글이 보내졌다..

다른 분들에게 도움이 될지는 모르겠으나. 로그를 남긴다.