06-24-2009
What is the programming language you are using? There is urldecode() in PHP, decodeURIComponent() in Javascript, and other similar functions in other languages. Do make sure the bytes are correct after you get decoded.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm trying to replace the string %2d from a text file using sed, and I can't seem to find the right key combination. I've tried:
sed 's/%2d/-/' foo
The above doesn't work, presumably because of the %. :mad: Interestingly, I don't get any kind of error message at all. It appears to... (5 Replies)
Discussion started by: mg1
5 Replies
2. UNIX for Advanced & Expert Users
Hi all,
I need to write a unix script in which need to call a url.
Then need to pass parameters to that url.
please help.
Regards,
gander_ss (1 Reply)
Discussion started by: gander_ss
1 Replies
3. Shell Programming and Scripting
Hi all,
I need to write a unix script in which need to call a url.
Then need to pass parameters to that url.
please help.
Regards,
gander_ss (1 Reply)
Discussion started by: gander_ss
1 Replies
4. Shell Programming and Scripting
I've been trying to figure out how to extract filenames (with extensions) from a variable that contains a series of URL strings that won't necessarily be the same length or contain the same number of paths as part of a bash shell script. For example
#!/bin/bash
... (3 Replies)
Discussion started by: coupestyle
3 Replies
5. Web Development
I am trying to find a way to test some code, but I need to rewrite a specific URL only from a specific HTTP_HOST
The call goes out to
http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena
The ID in the middle is always random due to the cookie.
I... (5 Replies)
Discussion started by: EXT3FSCK
5 Replies
6. Shell Programming and Scripting
Could anyone of you please give me some idea to decode base 64 encoded value in ksh? (4 Replies)
Discussion started by: nram_krishna@ya
4 Replies
7. UNIX for Dummies Questions & Answers
Here is what I have so far:
find . -name "*php*" -or -name "*htm*" | xargs grep -i iframe | awk -F'"' '/<iframe*/{gsub(/.\*iframe>/,"\"");print $2}'
Here is an example content of a PHP or HTM(HTML) file:
<iframe src="http://ADDRESS_1/?click=5BBB08\" width=1 height=1... (18 Replies)
Discussion started by: striker4o
18 Replies
8. UNIX for Dummies Questions & Answers
The challenge:
Decode URL's, i.e. convert %HEX to the corresponding special characters, using only UNIX base utilities, and without having to type out each special character.
I have an anonymous C code snippet where the author assigns each hex digit a number from 0 to 16 and then does some... (2 Replies)
Discussion started by: uiop44
2 Replies
9. Shell Programming and Scripting
Hello,
Am very new to perl , please help me here !!
I need help in reading a URL from command line using PERL:: Mechanize and needs all the contents from the URL to get into a file.
below is the script which i have written so far ,
#!/usr/bin/perl
use LWP::UserAgent;
use... (2 Replies)
Discussion started by: scott_cog
2 Replies
10. UNIX for Dummies Questions & Answers
Hello everybody, i have a big issue, i have to decode a big text in base64 a lot of times but there are 2 problems: i am a noob with unix system and shell, and i have problems with openssl and i can't decode anything. can anyone decode for me that base64? need a powerful computer, i can give some... (16 Replies)
Discussion started by: supermarco2020
16 Replies
LEARN ABOUT DEBIAN
lingua::preferred
Preferred(3pm) User Contributed Perl Documentation Preferred(3pm)
NAME
Lingua::Preferred - Perl extension to choose a language
SYNOPSIS
use Lingua::Preferred qw(which_lang acceptable_lang);
my @wanted = qw(en de fr it de_CH);
my @available = qw(fr it de);
my $which = which_lang(@wanted, @available);
print "language $which is the best of those available
";
foreach (qw(en_US fr nl de_DE)) {
print "language $_ is acceptable
"
if acceptable_lang(@wanted, $_);
}
DESCRIPTION
Often human-readable information is available in more than one language. Which should you use? This module provides a way for the user to
specify possible languages in order of preference, and then to pick the best language of those available. Different 'dialects' given by
the 'territory' part of the language specifier (such as en, en_GB, and en_US) are also supported.
The routine "which_lang()" picks the best language from a list of alternatives. The arguments are:
o a reference to a list of preferred languages (first is best). Here, a language is a string like 'en' or 'fr_CA'. ('fr_*' can also be
given - see below.) 'C' (named for the Unix 'C' locale) matches any language.
o a reference to non-empty list of available languages. Here, a language can be like 'en', 'en_CA', or "undef" meaning 'unknown'.
The return code is which language to use. This will always be an element of the available languages list.
The cleverness of this module (if you can call it that) comes from inferring implicit language preferences based on the explicit list
passed in. For example, if you say that en is acceptable, then en_IE and en_DK will presumably be acceptable too (but not as good as just
plain en). If you give your language as en_US, then en is almost as good, with the other dialects of en following soon afterwards.
If there is a tie between two choices, as when two dialects of the same language are available and neither is explicitly preferred, or when
none of the available languages appears in the user's list, then the choice appearing earlier in the available list is preferred.
Sometimes, the automatic inferring of related dialects is not what you want, because a language dialect may be very different to the 'main'
language, for example Swiss German or some forms of English. For this case, the special form 'XX_*' is available. If you dislike Mexican
Spanish (as a completely arbitrary example), then "[ 'es', 'es_*', 'es_MX' ]" would rank this dialect below any other dialect of es (but
still acceptable). You don't have to explicitly list every other dialect of Spanish before es_MX.
So for example, supposing @avail contains the languages available:
o You know English and prefer US English:
$which = which_lang([ 'en_US' ], @avail);
o You know English and German, German/Germany is preferred:
$which = which_lang([ 'en', 'de_DE' ], @avail);
o You know English and German, but preferably not Swiss German:
$which = which_lang([ 'en', 'de', 'de_*', 'de_CH' ], @avail);
Here any dialect of German (eg de_DE, de_AT) is preferable to de_CH.
Whereas "which_lang()" picks the best language from a list of alternatives, "acceptable_lang()" answers whether a single language is
included (explicitly or implicitly) in the list of wanted languages. It adds the implicit dialects in the same way.
AUTHOR
Ed Avis, ed@membled.com
SEE ALSO
perl(1).
perl v5.8.8 2005-10-17 Preferred(3pm)