تنظيم صفحاتك في مجموعات يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
لا يمكن أن تكون بعض الأحرف جزءًا من عنوان URL (مثل المسافة)، ولبعض الأحرف الأخرى معنى خاص في عنوان URL. في نماذج HTML، يتم استخدام الحرف = للفصل بين الاسم والقيمة. يستخدم التركيب العام لمعرّف الموارد الموحّد ترميز عنوان URL للتعامل مع هذه المشكلة، بينما تستخدم نماذج HTML بعض عمليات الاستبدال الإضافية بدلاً من تطبيق الترميز بالنسبة المئوية على جميع هذه الأحرف.
على سبيل المثال، يتم ترميز المسافات في السلسلة باستخدام %20 أو استبدالها بعلامة الجمع (+). إذا كنت تستخدم رمز الخط العمودي (|) كفاصل، احرص على ترميز الخط العمودي على النحو التالي: %7C. يجب ترميز الفاصلة في السلسلة على النحو %2C.
ننصحك باستخدام مكتبات إنشاء عناوين URL العادية الخاصة بمنصتك لتشفير عناوين URL تلقائيًا، وذلك لضمان إلغاء الأحرف الخاصة في عناوين URL بشكل صحيح على منصتك.
إنشاء عنوان URL صالح
قد يبدو لك أنّ عنوان URL "صالح" هو أمر بديهي، ولكن هذا ليس صحيحًا تمامًا. قد يحتوي عنوان URL تم إدخاله في شريط العناوين في متصفّح، على سبيل المثال، على أحرف خاصة (مثل "上海+中國")، ويحتاج المتصفّح إلى ترجمة هذه الأحرف داخليًا إلى ترميز مختلف قبل الإرسال. وبالمثل، قد يتعامل أي رمز برمجي ينشئ أو يقبل إدخال UTF-8 مع عناوين URL التي تتضمّن أحرف UTF-8 على أنّها "صالحة"، ولكنّه سيحتاج أيضًا إلى ترجمة هذه الأحرف قبل إرسالها إلى خادم ويب. تُعرف هذه العملية باسم ترميز عنوان URL أو الترميز بالنسبة المئوية.
الرموز الخاصة
نحتاج إلى ترجمة الأحرف الخاصة لأنّه يجب أن تتوافق جميع عناوين URL مع البنية المحدّدة في مواصفات معرّف الموارد المنتظم (URI). يعني ذلك أنّ عناوين URL يجب أن تتضمّن مجموعة فرعية خاصة من أحرف ASCII فقط، وهي الرموز الأبجدية الرقمية المألوفة وبعض الأحرف المحجوزة لاستخدامها كأحرف تحكّم ضمن عناوين URL. يوضّح الجدول التالي هذه الأحرف:
ملخّص الأحرف الصالحة في عناوين URL
تم الضبط
الأحرف
استخدام عناوين URL
أحرف أبجدية رقمية
a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9
سلاسل النصوص واستخدام المخطط (http) والمنفذ (8080) وما إلى ذلك
غير محجوز
- _ . ~
السلاسل النصية
تم الحجز
! * ' ( ) ; : @ & = + $ , / ? % # [ ]
أحرف التحكّم و/أو السلاسل النصية
عند إنشاء عنوان URL صالح، يجب التأكّد من أنّه يحتوي على الأحرف الموضّحة في الجدول فقط. يؤدي الالتزام بمجموعة الأحرف هذه في عناوين URL بشكل عام إلى مشكلتَين، إحداهما تتعلق بالحذف والأخرى بالاستبدال:
تتوفّر أحرف تريد التعامل معها خارج المجموعة المحدّدة أعلاه. على سبيل المثال، يجب ترميز الأحرف في اللغات الأجنبية، مثل 上海+中國، باستخدام الأحرف المذكورة أعلاه. وبموجب الاتفاقيات الشائعة، غالبًا ما يتم تمثيل المسافات (غير المسموح بها ضمن عناوين URL) باستخدام علامة الجمع '+' أيضًا.
تتضمّن المجموعة أعلاه أحرفًا محجوزة، ولكن يجب استخدامها حرفيًا. على سبيل المثال، يتم استخدام ? ضمن عناوين URL للإشارة إلى بداية سلسلة طلب البحث. إذا أردت استخدام السلسلة "? and the Mysterions"، عليك ترميز الحرف '?'.
يتم ترميز جميع الأحرف التي سيتم ترميزها باستخدام عنوان URL باستخدام الحرف '%' وقيمة سداسية عشرية مكوّنة من حرفين تتوافق مع حرف UTF-8. على سبيل المثال، سيتم ترميز 上海+中國 في UTF-8 على شكل %E4%B8%8A%E6%B5%B7%2B%E4%B8%AD%E5%9C%8B في عنوان URL. سيتم ترميز السلسلة ? and the Mysterians بنظام عناوين URL على النحو التالي: %3F+and+the+Mysterians أو %3F%20and%20the%20Mysterians.
الأحرف الشائعة التي يجب ترميزها
بعض الأحرف الشائعة التي يجب ترميزها هي:
حرف غير آمن
القيمة المشفرة
مسافة
%20
"
%22
<
%3C
>
%3E
#
%23
%
%25
|
%7C
قد يكون تحويل عنوان URL الذي تتلقّاه من إدخال المستخدم أمرًا صعبًا في بعض الأحيان. على سبيل المثال، قد يُدخل المستخدم عنوانًا على النحو التالي: "شارع 5 وشارع Main". بشكل عام، يجب إنشاء عنوان URL من أجزائه، مع التعامل مع أي إدخال من المستخدم كأحرف حرفية.
بالإضافة إلى ذلك، يقتصر عدد الأحرف في عناوين URL على 16384 حرفًا لجميع خدمات الويب الثابتة وخدمات الويب في "منصة خرائط Google". في معظم الخدمات، نادرًا ما يتم بلوغ الحدّ الأقصى لعدد الأحرف. ومع ذلك، تجدر الإشارة إلى أنّ بعض الخدمات تتضمّن عدة مَعلمات قد تؤدي إلى إنشاء عناوين URL طويلة.
تاريخ التعديل الأخير: 2025-08-12 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-08-12 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eURLs can only contain a specific set of ASCII characters and some reserved characters, requiring encoding of other characters.\u003c/p\u003e\n"],["\u003cp\u003eURL encoding involves replacing unsafe characters with a '%' followed by their two-digit hexadecimal UTF-8 representation.\u003c/p\u003e\n"],["\u003cp\u003eCharacters like spaces, quotation marks, less than, greater than, hash, percent, and pipe often require URL encoding.\u003c/p\u003e\n"],["\u003cp\u003eBuilding URLs programmatically using platform libraries is recommended for automatic and proper encoding.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Maps Platform web services and static web APIs have a URL character limit of 16384.\u003c/p\u003e\n"]]],["URLs require encoding because they only accept a specific subset of ASCII characters. Special characters, like spaces and foreign language characters, must be encoded using percent encoding (e.g., `%20` for space) or plus signs in specific instances. Reserved characters, such as `=`, `?`, and `|`, also need encoding when used literally, not as control characters. It's best to utilize platform URL building libraries for automatic encoding, guaranteeing proper escaping, because it can be complex to do manually. It is also important to note that URLs are limited to 16384 characters for Google Maps Platform web services.\n"],null,["Some characters cannot be part of a URL (for example, the space) and some other\ncharacters have a special meaning in a URL. In HTML forms, the character `=` is\nused to separate a name from a value. The URI generic syntax uses URL encoding\nto deal with this problem, while HTML forms make some additional substitutions\nrather than applying percent encoding for all such characters.\n\nFor example, spaces in a string are either encoded with `%20` or replaced with\nthe plus sign (`+`). If you use a pipe character (`|`) as a separator, be sure\nto encode the pipe as `%7C`. A comma in a string should be encoded as `%2C`.\n\nIt is recommended you use your platform's normal URL building libraries to\nautomatically encode your URLs, to ensure the URLs are properly escaped for your\nplatform.\n\nBuilding a valid URL\n\nYou may think that a \"valid\" URL is self-evident, but\nthat's not quite the case. A URL entered within an address bar in a\nbrowser, for example, may contain special characters (e.g.\n`\"上海+中國\"`); the browser needs to internally translate\nthose characters into a different encoding before transmission.\nBy the same token, any code that generates or accepts UTF-8 input\nmight treat URLs with UTF-8 characters as \"valid\", but would also need\nto translate those characters before sending them out to a web server.\nThis process is called [URL-encoding](https://en.wikipedia.org/wiki/Query_string#URL_encoding) or [percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nSpecial characters\n\nWe need to translate special characters because\nall URLs need to conform to the syntax specified by the\n[Uniform\nResource Identifier (URI)](http://tools.ietf.org/html/rfc3986) specification. In effect, this means that URLs\nmust contain only a special subset of ASCII characters: the familiar\nalphanumeric symbols, and some reserved characters for use as control\ncharacters within URLs. This table summarizes these characters:\nSummary of Valid URL Characters\n\n| Set | characters | URL usage |\n|--------------|-----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|\n| Alphanumeric | a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 | Text strings, scheme usage (`http`), port (`8080`), etc. |\n| Unreserved | - _ . \\~ | Text strings |\n| Reserved | ! \\* ' ( ) ; : @ \\& = + $ , / ? % # \\[ \\] | Control characters and/or Text Strings |\n\nWhen building a valid URL, you must ensure that it contains only those characters shown in the\ntable. Conforming a URL to use this set of characters generally\nleads to two issues, one of omission and one of substitution:\n\n- Characters that you wish to handle exist outside of the above set. For example, characters in foreign languages such as `上海+中國` need to be encoded using the above characters. By popular convention, spaces (which are not allowed within URLs) are often represented using the plus `'+'` character as well.\n- Characters exist within the above set as reserved characters, but need to be used literally. For example, `?` is used within URLs to indicate the beginning of the query string; if you wish to use the string \"? and the Mysterions,\" you'd need to encode the `'?'` character.\n\nAll characters to be URL-encoded are encoded\nusing a `'%'` character and a two-character hex\nvalue corresponding to their UTF-8 character. For example,\n`上海+中國` in UTF-8 would be URL-encoded as\n`%E4%B8%8A%E6%B5%B7%2B%E4%B8%AD%E5%9C%8B`. The\nstring `? and the Mysterians` would be URL-encoded as\n`%3F+and+the+Mysterians` or `%3F%20and%20the%20Mysterians`.\n\nCommon characters that need encoding\n\nSome common characters that must be encoded are:\n\n| Unsafe character | Encoded value |\n|------------------|---------------|\n| Space | `%20` |\n| \" | `%22` |\n| \\\u003c | `%3C` |\n| \\\u003e | `%3E` |\n| # | `%23` |\n| % | `%25` |\n| \\| | `%7C` |\n\nConverting a URL that you receive from user input is sometimes\ntricky. For example, a user may enter an address as \"5th\\&Main St.\"\nGenerally, you should construct your URL from its parts, treating\nany user input as literal characters.\n\nAdditionally, URLs are limited to 16384 characters for all Google Maps Platform web services\nand static web APIs. For most services, this character limit will seldom be approached. However,\nnote that certain services have several parameters that may result in long URLs."]]