java.net.URLEncoder.scala Maven / Gradle / Ivy
The newest version!
package java.net
import java.io.UnsupportedEncodingException
import scala.scalajs.js
object URLEncoder {
def encode(s: String, enc: String): String = {
if (enc != "UTF-8")
throw new UnsupportedEncodingException(enc)
else
js.Dynamic.global.encodeURI(s).asInstanceOf[String]
}
}