-
Notifications
You must be signed in to change notification settings - Fork 5
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
treat @ARGV as utf8 string #7
Comments
read https://perldoc.perl.org/perlunitut#I/O-flow-(the-actual-5-minute-tutorial)
|
@grr True for your own programs, but for ones that are bundled as part of a module? They should be doing the decoding. But it's not as easy as just decoding UTF-8, because the input might not even be UTF-8 (cough Windows cough). See this stackoverflow question for some ways to do it portably. |
* Get the encoding used for command line arguments from the environment. Fixes issue manwar#7. * Don't assume standard input and output are UTF-8; also get their encoding from the environment.
* Get the encoding used for command line arguments from the environment. Fixes issue manwar#7. * Don't assume standard input and output are UTF-8; also get their encoding from the environment.
@shawnw, you're right- i overlooked you were referring to the program and not the module. note that your fix will require increasing the MIN_PERL_VERSION to 5.8 as I18N::Langinfo is not dual-life (only ships with perl and not available separately):
|
I hope nobody's using a version that outdated, but I'll bump it anyways. |
i face some problem when using command line tool
xpath
.when my query contain non-ascii string like
xpath -e '//*[contains(., "早安")'
,xpath match nothing.
using
perl -CA
option to make perl treat@ARGV
as utf8 fix this problem,so it sould be caused by argv encoding problem.
i am not familiar with perl, so i am not sure what is the best solution
of argv encoding problem.
The text was updated successfully, but these errors were encountered: