Topic "Incorrect chars when upload files [SOLVED]"

Author Message
leofire
[View user's profile]
Donor
Joined: 2013-10-17
Posts: 2
Location: Italy
Hi to all,

I'm trying to upload PHP file with this chars:
"","","","","","","#","","",""

but when I reopen file I obtain this result:
"ì","é","è","ç","ò","°","#"," ","§","ù"

To fix this, at the moment, I need to edit file (double click on winscp remote screen), change manually this strange chars (for example "ì" and change to ""). When I save and reopen it I can see the correct chars.
There is a manner to fix this issue ?
Thanks in advance,


Leonardo

Last edited by leofire on 2013-10-23 16:57; edited 1 time in total
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Try setting session settings UTF-8 Encoding for Filenames to On.
http://winscp.net/eng/docs/ui_login_environment#utf
Guest




Hi prikryl,

thanks for your suggestion. I have tried with different FTP account but any result.
I have change the option to UTF-8 to "attivo" (Active), I can login correctly but still anything... Sad

With this option you can upload the file correctly ?
Thanks in advance,


Leonardo
Guest




Could you try to upload this file and check it please ?
With other FTP client I can upload correctly.
Thanks in advance,


Leonardo
strange_chars.txt (189 Bytes) [Download]

Description: Strange Chars (rename to PHP and upload with Winscp)

Guest




Hi prikryl,

have you tried to upload this files ?
Everythign works fine for you ?
Thanks,


Leonardo
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Sorry, I've misunderstood your problem.
Does this problem happen when you simply upload the file or when you open it in an editor (internal or external?) from WinSCP and save it?
Guest




Hi prikryl,

I just upload the files with ,, and when I open it (via shell or through winscp editor) I cannot see the correct chars.
Thanks for your help,


Leonardo
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Your file is in UTF-8 encoding, but lacks BOM. WinSCP internal editor opens the file using ANSI encoding, when it lacks BOM, by default. You can switch to UTF-8 in the editor or make WinSCP default to UTF-8 in preferences:
http://winscp.net/eng/docs/ui_editor
http://winscp.net/eng/docs/ui_pref_editor

As for the shell: Your terminal client probably defaults to ANSI encoding too. It's also possibly that your host does not use UTF-8 encoding.
_________________
Martin Prikryl
leofire
[View user's profile]
Donor
Joined: 2013-10-17
Posts: 2
Location: Italy
Hi prikryl,

thanks for your right suggest, you're great!
I have changed the editor to UTF8 and now I can see the correct chars when I use the
I have also added the header in PHP like this:
header('Content-Type: text/html; charset=utf-8');

and I can see all chars correctly!
If I try to use a str_replace in order to replace "" with "a" it works perfectly!
Probably vi from shell use the same encoding.
Many thanks for your suggest and have a good day,


Leonardo
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License