import java.util.Map;
-import net.pterodactylus.util.number.Hex;
import net.pterodactylus.util.template.Filter;
import net.pterodactylus.util.template.TemplateContext;
+import com.google.common.io.BaseEncoding;
+
/**
* Escapes double quotes, backslashes, carriage returns and line feeds, and
* additionally encloses a given string with double quotes to make it possible
javascriptString.append('\\');
javascriptString.append(c);
} else if (c < 32) {
- javascriptString.append("\\x").append(Hex.toHex((byte) c));
+ javascriptString.append("\\x").append(BaseEncoding.base16().lowerCase().encode(new byte[] { (byte) c }));
} else {
javascriptString.append(c);
}