Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utf8 flag missing #37

Closed
eserte opened this issue Mar 31, 2015 · 7 comments
Closed

utf8 flag missing #37

eserte opened this issue Mar 31, 2015 · 7 comments

Comments

@eserte
Copy link

eserte commented Mar 31, 2015

At least the German area names are not properly encoded. Here's a sample (Donauwörth):

$ perl -MDevel::Peek -MNumber::Phone -e 'Dump(Number::Phone->new("+49 906 1234567")->areaname)'  
SV = PV(0x2565280) at 0x242ca10
  REFCNT = 1
  FLAGS = (TEMP,POK,pPOK)
  PV = 0x2121c40 "Donauw\303\266rth"\0
  CUR = 11
  LEN = 16

Correct output should be:

  ...
  FLAGS = (POK,pPOK,UTF8)
  PV = 0x11315c0 "Donauw\303\266rth"\0 [UTF8 "Donauw\x{f6}rth"]
  ...
@DrHyde
Copy link
Owner

DrHyde commented Mar 31, 2015

Thanks. Does 5305eac fix it? It looks like it does to me, but I don't really understand all these Unicode shenanigans so shouldn't be trusted!

To test it you'll need to run build-data.sh and have the following additional modules installed:

  • XML::XPath
  • Digest::MD5
  • File::Find::Rule
  • Spreadsheet::ParseExcel
  • Text::CSV_XS

and the machine running the build script needs git and curl installed and access to the interwebnets, possibly some other stuff that I've forgotten too :-)

@eserte
Copy link
Author

eserte commented Apr 1, 2015

Yes, it works. Another possibility (probably slightly more efficient) would be to use utf8; and remove the backslashes before high bit characters, and no map { ...Encode::decode... }.

Another observation: with newest ExtUtils::MakeMaker value of the PERL variable in the generated Makefile is always quoted (even on Unix systems), so the last command in the build script fails:

./build-data.sh: line 110: "/usr/perl5.20.2p/bin/perl": No such file or directory

@eserte eserte closed this as completed Apr 1, 2015
@DrHyde
Copy link
Owner

DrHyde commented Apr 1, 2015

That's odd. Does /usr/perl5.20.2p/bin/perl exist on that machine? Because having extraneous quotes around an executable name shouldn't affect anything ...

$ "/usr/bin/which" which
/usr/bin/which
$ /usr/bin/which which
/usr/bin/which

even in a script ...

$ cat foo
#!/bin/sh
/usr/bin/which which
"/usr/bin/which" which
$ ./foo
/usr/bin/which
/usr/bin/which

@eserte
Copy link
Author

eserte commented Apr 1, 2015

But in backticks it's different:

$ `echo '/usr/bin/which' which`
/usr/bin/which
$ `echo '"/usr/bin/which"' which`
bash: "/usr/bin/which": No such file or directory

(Linux and FreeBSD, bash and zsh)

@DrHyde
Copy link
Owner

DrHyde commented Apr 1, 2015

I fucking hate Unix sometimes!

@DrHyde
Copy link
Owner

DrHyde commented Apr 1, 2015

Should be fixed in 3865fda. Please test!

@eserte
Copy link
Author

eserte commented Apr 3, 2015

Tested 62b2ac5 --- the Makefile re-build problem is fixed, and the changed implementation with use utf8 looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants