Re: Can I upload Perl program in unicode?




"Bill H" <bill@xxxxxxxxx> wrote in message
news:fd3681e1-d79a-47bb-862d-7edd735feef0@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 29, 5:54 pm, nntpman68 <news1...@xxxxxxx> wrote:
Just out of curiosity:

What was now the root cause?

bye

N



John wrote:
"szr" <sz...@xxxxxxxxxxxxxxx> wrote in message
news:g6nfae0241m@xxxxxxxxxxxxxxxxxxxx
Ben Bullock wrote:
On Tue, 29 Jul 2008 09:57:57 +0200, Christian Winter wrote:

John schrieb:
If a Perl script can be encoded in UTF8, the problem must lie with
the upload. I use WS_FTP Pro on my Windows (sorry) machine
A lot of people here use Perl on Windows. One of my main uses for Perl
is manipulating Microsoft Word/Excel documents via Win32::OLE.

and vsftpd on my
linux server. I need to look at the setup on both.
Did you know you can use Explorer as an ftp client on Windows? It's
fairly handy.

Also have a look at line endings, windows-style line ends
(CRLF) generally don't mix well with Perl on *nix systems
The only problem with these on Unix systems is "bad interpreter"
messages if there is a ^M at the end of the #! line. But these
messages come from the shell, not Perl itself. Perl is able to cope
with any kind of line endings on Unix, so you can run your scripts
as "perl myscript" it will be OK.
Another little trick I've used before in such situations is, after
uploading, go to your Linux shell and open the script in 'pico', then
save
the file. When pico saves the file, it will have converted any \CR\LF
sequences to just LF. I am not sure who it handles UTF8, however. And
I'm
sure there are other tools for converting as well.

--
szr

Good news. It is all working fine now. I tested it with French, German,
Persian, Chinese and Greek.
I had some problems with DBI and MySQL with Perl and UTF8 but I managed
to
get that to work too.
Many thanks for all the input.
Regards
John- Hide quoted text -

- Show quoted text -

Was wondering that myself

Bill H


Hi

Here's the solution.

On my Windows machine I use ScITE as my editor for Perl. I set the ENCODING
as UTF8 and I can see all the correct characters - whether German , Chinese,
etc. However I save with ENCODING set to 8-bit. I upload with WS_FTP PRO.
WS_FTP is set to auto mode so that any .PL: is transferred as ASCII. On the
linux server, I use vsftpd. In the conf file I set both ascii_upload_enable
and ascii_download_enable to YES. The unicode characters are displayed
correctly.

There is probably a more elegant solutuion.

Hope that helps.
John


.



Relevant Pages