Outil en ligne de codage d'URL
Le résultat sera affiché ici.
xxxxxxxxxx
1
1
À propos deOutil en ligne de codage d'URL:
Cet outil de codage d'URL en ligne peut vous aider à convertir une chaîne d'entrée en une chaîne de format d'URL.
Table de conversion de codage d'URL:
! | # | $ | & | ' | ( | ) | * | + | , | / | : | ; | = | ? | @ | [ | ] |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
%21 | %23 | %24 | %26 | %27 | %28 | %29 | %2A | %2B | %2C | %2F | %3A | %3B | %3D | %3F | %40 | %5B | %5D |

Calculer le codage d'URL d'une chaîne en Python:
- import urllib.parse
- def url_encode(input_str):
- output_msg = urllib.parse.quote(input_str).strip()
- return output_msg
Calculer le codage d'URL d'une chaîne en Java:
- import java.io.UnsupportedEncodingException;
- import java.net.URLEncoder;
- public class URL {
- public static String url_encode(String url) throws UnsupportedEncodingException {
- return URLEncoder.encode(url, "UTF-8");
- }
- public static void main(String[] args) throws UnsupportedEncodingException {
- String result = url_encode("https://maps.google.com/maps?ll=37.413323,-122.081267&z=11&q=Mountain View California USA");
- System.out.println(result);
- }
- }
- -------------------
- https%3A%2F%2Fmaps.google.com%2Fmaps%3Fll%3D37.413323%2C-122.081267%26z%3D11%26q%3DMountain+View+California+USA