Convert from hex

perl -e '
print "$_";

This outputs

Why does print not print the hex character in question?

-bash-2.05b$ perl -e '
 > print 
 > '$

outputs it.

8/9/2007 10:31:30 AM
perl.beginners 29388 articles. 4 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 43
Get it on Google Play
Get it on Apple App Store

kapil.V wrote:
>  echo 
> perl -e '
> $_=<>;s/%(..)/\\x$1/xg;
> print "$_";
> '

echo| perl -e '
print "$_";

Just my 0.00000002 million dollars worth,

"For the things we have to learn before we can do them, we learn by doing them."
8/9/2007 12:25:01 PM
On 8/9/07, kapil.V <> wrote:
>   echo
> perl -e '
> $_=<>;s/%(..)/\\x$1/xg;
> print "$_";
> '
> This outputs
> http\x3A\x2F\\x2Fuploads\x2Fmf_aR_Ek_Ajnabi_-_01_-_Ek_Ajnabi_\x28Mama_Told_Me\x29\x28128Kbps\x29.mp3
> Why does print not print the hex character in question?
> But,
> -bash-2.05b$ perl -e '
>  > print
> "http\x3A\x2F\\x2Fuploads\x2Fmf_aR_Ek_Ajnabi_-_01_-_Ek_Ajnabi_\x28Mama_Told_Me\x29\x28128Kbps\x29.mp3"
>  > '
> outputs it.
> Thanks,
> Kapil.V

Because '\' . 'x' . '2' . 'F' is not the same as "\x2F".  Certain
character sequences have meaning when they are included in a double
quoted string, but that does not mean that the characters have the
meaning in and of themselves.  It is the act of putting them in a
double quoted string that gives them their meaning.
8/9/2007 12:38:19 PM

Similar Artilces:

how to convert hex string to hex bytes?
Hi I've been trying and haven't found a solution for this yet and hopefully some of you can give me a direction to solve this problem. I have a string in hex representation i.e, 64 chars 'AB23FFFE.....' How can I convert it to 32 chars String where each byte is $AB $23 $FF $FE .... ? Even if I do it manually, can I store the hex(non ASCII) to String? Thanks for looking!! edwin wrote: > I have a string in hex representation i.e, 64 chars 'AB23FFFE.....' > How can I convert it to 32 chars String where each byte is $AB $23 $FF > $FE .... ? Th...

Converting to Hex
Is there a simple way, like a one liner perhaps, that will give me the octal/hex value of a character? I need to look certain characters up, so I would like to be able to give it something like an 'a' or even "\n" and have it answer 141 or 012 (assuming UNIX). Thanks for your time. James check out sprintf() and ord() quickly for you example: ## hex perl -e 'printf("%x", ord("\n"))' ## oct perl -e 'printf("%o", ord("\n"))' > -----Original Message----- > From: James Edward Gray II [m...

Converting string to Hex
I'm trying to convert a single character, into a Hex value, and compare. Here's my code: dim int as integer int = Integer.Parse(messages.Substring(x, 1), System.Globalization.NumberStyles.HexNumber) If int = &H0 Or int = &HC Then 'Do stuff end if Unfortunately, this causes an error with the character I'm trying to catch. Does anyone have any ideas? int = Integer.Parse(messages.Substring("x", 1), System.Globalization.NumberStyles.HexNumber) View My Blog Download My URL Rewriter and Reverse ProxyOnly $9.95/month, ASP.NET, 2GB & SQL 2005...

How to convert decimal to hex?
Hi all, Please tell me how to convert a decimal number like 255 into its corresponding hex value. For example I want a result of "ff" for a decimal of 255. I've tried playing with the functions ord, hex, pack, ... but with no result. Thank you. Teddy's Center: Mail: $HEX = sprintf "%1x", $DEC; for more, perldoc -f sprintf Rgds, Connie ----- Original Message ----- From: "Octavian Rasnita" <> To: <> Sent: Friday, August 09, 2002 3:11 ...

converting HEX to numbers
I need to call Win API methods from PB and I have an example of how they do it in VB. So I am converting the code to PB. However, there are variable declarations that I need help with: HOW CAN I CONVENRT THESE HEX NUMBERS INTO REAL NUMBERS TO DECLARE IN PB? e.g. &H20 is equal to what in PB? constant integer DT_RIGHT = &H2 constant integer DT_SINGLELINE = &H20 constant integer DT_TABSTOP = &H80 constant integer DT_TOP = &H0 constant integer DT_VCENTER = &H4 constant integer DT_WORDBREAK = &H10 constant integer PS_ENDCAP_FLAT = &H200 ...

convert binary to hex
--0016e64ca8a6352578047a573c11 Content-Type: text/plain; charset=ISO-8859-1 Hi ,all : I'd like to convert binary file intohex , but when I use perl's built in functions I keep getting extra bits on the end. cat bin_file 00000000000000000000100001100010 00010000010100100001100001000010 My perl script is the following : #!/usr/bin/perl use strict; while (<>){ my $line = $_; my $hex = unpack ("H*", pack("B*", $line)); print "$hex\n"; } But the result is : 0x0000086200 0x1052184...

converting character to hex
In, I would like to convert a character to hex and decimal (both) and then examine values. How is this done? Thanks See the Microsoft.VisualBasic.Conversion namespace for .Hex().  To convert from Hex to decimal I believe you just put a & in front of the hex value and either the Val() or Str() will return the decimal value. may i know how to get the data from hexadecimal format using visual ..i have the data strored in hexadecimal format in databse. I want retrie the data from the database ..can any body help me please... Thanks Sumna...

This is driving me insane: When e export a stream (like login-script) with ICE or NLIST, I only get ASCII code. Anyone any Idea how I can get tis converted to TEXT?? __Leo , > When e export a stream (like login-script) with ICE or NLIST, I only get > ASCII code. Anyone any Idea how I can get tis converted to TEXT?? > NLIST should show it as text. What syntax are you using? - Anders Gustafsson, Engineer, CNE6, ASE NSC Volunteer Sysop Pedago, The Aaland Islands (N60 E20) Novell does not monitor these forums officially. Enhancement requests for all Novell products...

Converting HEX to ASCII
I am using the "photo" attribute to store the location the jpg of our users (this is what eGuide users). When I try to read this attribute out with IDM 3.0, it returns a HEX value. How can I get it in the ASCII value. I have the same type of issue trying to read the Personal Login Script.....Any ideas? Actually it is probably returning a base64 encoded value rather than a hex value - this is because the attribute is a octet string attribute which may or may not represent characters (usually it is the actual picture data). An example of how to decode base64 from a p...

How to convert decimal to Hex?
Usually it is customary to include body in your posts but here we go. There are infinitely many ways to do this but the two I have used are decimal to hex or decimal to binary to hex. THe main advantage of the latter is that it is extremely easy to go from binary to hex and from decimal to binary. First you need to know how many bytes are in the number you are dealing with. Each byte is two hexidecmal digits (digits isn't really the right word but you know what I mean). So for a two byte or 16 bit number there are 4 hex digits. hexidecimal digits go from 0 to 15 wi...

Convert Hex to Char
Dear all, i tried to search on tis forum for converting a hex value to Char, but seems like i cant found any related. can any1 direct me o give me some hint?let say user type in 343536 in my text box, once they start the button subroutine, they should get 4 5 6 in char. Best Regardslife's Ng What's the formula for converting HEX to char? To me it just seems to scratch chars delimited by some particular number (3 in this case).Welcome to my SQL/ASPNET forum for Chinese what yo mean by Hex, is it  means hexadecimal, if so how yo...

Convert Hex to Unicode...
Hi... Does anyone know a simple way to convert hex back to the original chinese/arabic etc. language? I found a sample asking to do something like &#90AE, &#7BB1; but I dont really understand it... It will be easier to convert Arabic than Chinese because the Chinese alphabet is more than two thousand characters.  The link below contains the ASCII lookup table which includes hex values.  I am sorry I cannot help you with the actual conversion.  Hope this helps. regards,Gift Peddie...

Convert Hex To Int
I'm wondering if there is any easy way to convert a hex value to an int. I have a 3rd party component, that when used with will only accept color values as an int. For example:#FFFFFF = 16777215#000000 = 0 Hopefully I explained what I am looking for clearly. Thanks for any help,Russ Merry Christmas! <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <script runat="server"> protected void Button1_Click(object sender, EventArgs e) {   Label1.Text = HexToIn...

How to convert MemoryStream string to Hex?
I'm doing some encryption and, normally would return a baes 64 string but it's causing issues with URLs, so we are going to use hex strings instead....but I'm having an issue... Instead of:Return Convert.ToBase64String(ms.GetBuffer(), 0, CInt(ms.Length)) I'd like to return a hex string... I need a pointer here....thanks..... Dim myNumber as integer = 'Get your Number from the buffer Dim HexString as string = myNumber.tostring("X")Bryan SampicaAuction Site StarterKit |My Blog The tough part is the "get your number from the buffer" part.... That's what I don't get/know. I'm trying to...

Web resources about - Convert from hex - perl.beginners

List of converts to Buddhism - Wikipedia, the free encyclopedia
Ajahn Brahm (born 1951), Religious teacher and student of the late Thai monk Ajahn Chah . Currently he is the abbot of the Bodhinyana Monastery, ...

Facebook Timeline For Pages: 8 Million Converts, 29 Million To Go
... reach to 98 percent of users who liked its page, as well as to double its engagement rate, during a 28-day period. Dr. Pepper hasn’t yet converted ...

Facebook stock roundup: Execs offload more stock, directors convert shares
... Bowles, the former co-chair of the now-defunct National Commission on Fiscal Responsibility and Reform, and Reed Hastings, Netflix CEO, converted ...

How to Convert Leads Into Buying Customers - The 9 Step Sales Process EVERYONE Should Use
... School of Business in Toronto on the topics of Sales and Entrepreneurship. I shared with them the sales process that I find How to Convert Leads ...

Bitcoin : Should I convert my savings to Bitcoin?
Answer (1 of 7): You should think of this question as "Should I invest all my savings in Bitcoin?", and not "Should I have my savings denominated ...

Coordinates - Calculate and Convert a Position on the App Store on iTunes
Get Coordinates - Calculate and Convert a Position on the App Store. See screenshots and ratings, and read customer reviews.

Radical plan to convert Domain Stadium into a wave park
The man behind a radical plan to convert Domain Stadium into an artificial wave park, says it will become &nbsp;a sporting spectacle for wave-starved ...

WWE diva converts to Christianity, confesses to a life of sin
Stunning wrestling diva Taryn Terrell has shared a dramatic knock-down testimony of conversion from life in the ring to life with Christ.

Microsoft converts more customers into testers with Office Insider preview program
Microsoft today launched a new preview program for consumers who subscribe to Office 365 that will give them a sneak peak at new features slated ...

'Water Bug' Robot Digests Pollution, Converts it to Electricity
The Row-Bot was capable of generating more energy than it needed.

Resources last updated: 11/25/2015 4:26:48 AM