All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.lemonlabs.uri.decoding.PermissiveDecoder.scala Maven / Gradle / Ivy

The newest version!
package io.lemonlabs.uri.decoding

case class PermissiveDecoder(child: UriDecoder) extends UriDecoder {
  def decode(s: String) = {
    try {
      child.decode(s)
    } catch {
      case _: Throwable => s
    }
  }

  def decodeBytes(s: String, charset: String): Array[Byte] = {
    try {
      child.decodeBytes(s, charset)
    } catch {
      case _: Throwable => s.getBytes(charset)
    }
  }
}

object PermissivePercentDecoder extends PermissiveDecoder(PercentDecoder)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy