URL encode the string

Contents

Output

toyota%20%E8%BB%8A


Code examples


JavaScript

orig = "toyota 車"
console.log(encodeURI(orig))

PHP

<?php
$orig = "toyota 車";
print(rawurlencode($orig))."\n";

Perl

use URI::Escape;
my $orig = "toyota 車";
print uri_escape($orig)."\n";

Python

import urllib.parse
orig = "toyota 車"
print(urllib.parse.quote(orig))

Ruby

require 'uri'
orig = "toyota 車"
print URI.escape(orig) + "\n"