Backwards question mark appearing in FTP'd file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Backwards question mark appearing in FTP'd file
# 1  
Old 03-17-2010
Backwards question mark appearing in FTP'd file

Hi all,

I'm trying to FTP what looks like a simple .txt file from my Windows XP desktop to my UNIX server. I've tried using several programs to do this including UltraEdit and FTP Commander. I have tried sending it ascii, binary and even let the program decide. But every time it arrives in UNIX it includes a character that looks like a backwards question mark at the very beginning and it screws up my scripts meant to read the file.

Any suggestions on how to get rid of this darn thing? Smilie
# 2  
Old 03-17-2010
what's the byte count before and after? what's the first char look like under UltraEdit's hex mode? [ctrl-h]
# 3  
Old 03-17-2010
Quote:
Originally Posted by curleb
what's the byte count before and after? what's the first char look like under UltraEdit's hex mode? [ctrl-h]
The byte count is the same on both the desktop and UNIX. The first character under UltraEdit's hex mode is FF followed by FE
# 4  
Old 03-17-2010
Appears to be a UTF-16 byte order mark:

Byte order mark - Wikipedia, the free encyclopedia

From another forum, one Unix utility to convert to UTF-8 (assuming your program cannot process UTF-16 encoded text) might be recode:

recode - GNU Project - Free Software Foundation (FSF)

There is also this utility which may be useful:

https://www.unix.com/unix-dummies-que...f-16-file.html

iconv -f UTF-16 -t UTF-8 myfile > temporary_file
grep '1 CHAR UNICODE' temporary_file
# 5  
Old 03-17-2010
Quote:
Originally Posted by turk451
Appears to be a UTF-16 byte order mark:

Byte order mark - Wikipedia, the free encyclopedia

From another forum, one Unix utility to convert to UTF-8 (assuming your program cannot process UTF-16 encoded text) might be recode:

recode - GNU Project - Free Software Foundation (FSF)

There is also this utility which may be useful:

https://www.unix.com/unix-dummies-que...f-16-file.html

iconv -f UTF-16 -t UTF-8 myfile > temporary_file
grep '1 CHAR UNICODE' temporary_file
I tried the iconv command and got the following error: iconv: can not initialize the conversion
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Nawk command not working for Question mark (?)

Hi Folks, I am facing an issue with nawk command. The data is as below: ABC0022,BASC,Scene Package,INR,02May17,XXX4266,be?. Hotel,3,AW01,Twin Room,61272,41308,39590,39590,X,X ABC0022,BASC,Scene Package,INR,02May17,XXX4266,be?. Hotel,3,AW02,Twin Room with Balcony,9272,85638,4520,9590,X,X... (1 Reply)
Discussion started by: kirans.229
1 Replies

2. Solaris

Question marks appearing instead of text entered

I have a netscape 4.79 browser for our GUI which connects to a Solaris5.8 box. During peek hours, we see question marks appearing in the screen instead of the text we enter. This results in query failure. This problem does not happen always, and is quite irritating because, we have to close the... (6 Replies)
Discussion started by: vanz
6 Replies

3. Shell Programming and Scripting

Question mark in filename

Dear All, I am trying to run some commands and I am getting question mark in filename as output files. Which is not a literal question mark however it is not standard output format for UNIX and it can not print it. The output files are extended with ? For example,... (2 Replies)
Discussion started by: hsmart
2 Replies

4. Shell Programming and Scripting

FTP file question.

Hi, In my Shell script I am Ftp'ing to another server and putting a file. How can i retain the same permission while I put the file? Or Can I change the permission to 777 once the put is complete ? Thanks in advance. (1 Reply)
Discussion started by: smc3
1 Replies

5. Shell Programming and Scripting

read file backwards

Assume file1 contains a list of strings. My first script is scanning the file and deals with the lines with a certain patern in it: grep 'somepatern' file1 \ while read LINE ; do doSomethingAboutIt done Now, I need a second script that deals with the same lines (& do something... (3 Replies)
Discussion started by: bluemoon1
3 Replies

6. UNIX for Advanced & Expert Users

Scanning file backwards

Is there any way to look for a directory path that is listed any number of lines *before* a keyword in an error message? I have a script that is trying to process different files that are always down a certain portion of a path, and if there is an error, then says there is an error, contact... (2 Replies)
Discussion started by: tekster757
2 Replies

7. Solaris

Help - File Manager not appearing

First I have to admit that I am not an unix expert, but I do know some basic things about the file systems. Anywho, one of my users' File Manager is not showing up as it normally does upon login. When I run a "ps -ea" I see "dtfile" in the list, but it does not show up. It's not in any of the... (0 Replies)
Discussion started by: tdpearson
0 Replies

8. UNIX for Dummies Questions & Answers

trailing question mark in filename

I have a script(ex.sh) with one line in it, running in bash shell. ls -l > /usr/ngasi/contexts/tdevoe/private/ex.txt when I run it , it creates the file with a trailing question mark -rwx------ 1 tdevoe webapp 59 Jun 7 06:42 ex.sh -rw------- 1 tdevoe webapp 3761 Jun ... (3 Replies)
Discussion started by: devoetfd
3 Replies

9. UNIX for Dummies Questions & Answers

? question mark, how to get back to the root directory

hiyas I am trying to get back to the root directory: I went into MAIL directory and now I can't get back to the root directory. What are the commands... I have '?' coming up and I cannot proceed with this, HELP Cheers (1 Reply)
Discussion started by: etravels
1 Replies
Login or Register to Ask a Question