Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Why are my hyphens in number strings stored as dots?

by oko1 (Deacon)
on Feb 14, 2012 at 03:07 UTC ( #953592=note: print w/ replies, xml ) Need Help??


in reply to Why are my hyphens in number strings stored as dots?

I'll agree with GrandFather, and add one: how about you show us the data, too - maybe by running it through 'hexdump -C' or some equivalent?

#!/usr/bin/perl -w use strict; my $s1 = "1\xe2\x80\x932\xe2\x80\x933"; my $s2 = "1-2-3"; print "$s1: not $s2, but a brilliant imitation!\n" unless $s1 eq $s2;

Output:

1𣇽: not 1-2-3, but a brilliant imitation!

Depending on your character set, those n-dashes could well end up looking like dots, etc.

-- 
I hate storms, but calms undermine my spirits.
 -- Bernard Moitessier, "The Long Way"


Comment on Re: Why are my hyphens in number strings stored as dots?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://953592]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2015-07-04 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls