Skip to content

Commit 1673279

Browse files
Merge pull request livecode#7150 from livecodesam/bugfix-22341
[Bugfix-22341] Add note about non-ASCII chars to URLDecode entry
2 parents c3d443e + 75def5a commit 1673279

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

docs/dictionary/function/URLDecode.lcdoc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,25 @@ the next two characters as <hexadecimal> digits. (If one of the
4141
number is converted to its <character> equivalent, using the
4242
<character set> currently in use.
4343

44+
>*Note:* Non-ASCII characters, such as Unicode, that appear in the URL
45+
> string to be decoded will have been encoded as UTF-8 (as per standard
46+
> convention), requiring the use of the <textDecode> <function(glossary)>
47+
> after urlDecode. For example, the following code:
48+
49+
local tEncodedText
50+
put "%D1%81%D0%BA%D0%BE%D1%80%D0%BE%D1%81%D1%88%D0%B8%D0" & \
51+
"%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8C" into tCodedText
52+
put textDecode(urlDecode(tEncodedText),"UTF-8")
53+
54+
> produces the word "скоросшиватель".
55+
4456
References: post (command), function (control structure),
4557
decompress (function), macToISO (function), arrayDecode (function),
46-
charToNum (function), baseConvert (function), decode (glossary),
47-
return (glossary), sign (glossary), encode (glossary),
58+
charToNum (function), baseConvert (function), textDecode (function),
59+
decode (glossary), return (glossary), sign (glossary), encode (glossary),
4860
character set (glossary), hexadecimal (glossary), server (glossary),
49-
URL (keyword), characters (keyword), character (keyword), http (keyword),
50-
httpHeaders (property)
61+
function (glossary), URL (keyword), characters (keyword),
62+
character (keyword), http (keyword), httpHeaders (property)
5163

5264
Tags: networking
5365

docs/notes/bugfix-22341.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Added a note to the URLDecode entry that non-ASCII output must be put through textDecode

0 commit comments

Comments
 (0)