it/JavaScript

인코딩, 디코딩

하얀나다 2017. 10. 10. 14:33

1바이트 문자는 %XX  2바이트 문자는 %uXXXX


escape();

알파벳 숫자 특수문자(@,*,-,_,+,.,/) 제외 모든 문자 인코딩


encodeURI(uri);

(:, ;, /, =, ?, &)추가


encodeURIComponent(uriComponent);

알파벳 숫자 제외한 모든 걸 인코딩


unescape();


decodeURI(encodedURI);


decodeURIComponent(encodedURI);