Copying a file with UTF char on UNIX server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Copying a file with UTF char on UNIX server
# 1  
Old 04-02-2015
Copying a file with UTF char on UNIX server

Hi,

I need to run a SQL which check for special UTF char in DB. When I try to copy that in UNIX file it changes it to some wierd chat. How can in retain the UTF chars in my script?

e.g. ο|π|ρ|σ|τ|υ|φ|χ|ψ

Any help will be appriciated.

Thanks,
# 2  
Old 04-02-2015
Show your code please. Without that I'd only be making wild guesses.
# 3  
Old 04-03-2015
You will need to make sure that your terminal/editor uses an utf8 locale. The locale command will show your settings and specifically you want to set LC_CTYPE to an utf8 locale (for example en_US.UTF-8).

How to go about it depends on your system (for debian linux: https://wiki.debian.org/Locale).
# 4  
Old 04-06-2015
$ locale
Code:
LANG=
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=


When I try to post UTF chat.. in a vi editior. It still changes to
Code:
.

# 5  
Old 04-06-2015
If you save that and view it with xdd/od -x, does it come up as 2e ? If it saves as two bytes instead, it is a font problem.
# 6  
Old 04-09-2015
hi varun,

- what is your unix system ?
- are you in console or term utility ?
- and please check endoding def for vi ? (:set fileencoding)
# 7  
Old 04-13-2015
Hi, I am using a solaris machine.

I am using a terminal (Putty)

set fileencoding is not a valid options.

Please help I really need to get this going
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Working with UTF char sqlplus

I have below SQL that I wasnt to run from a solaris machine using sqlplus select * from TABLE_NAME where regexp_like(field_value, 'Α|Β|Γ|Δ|Ε|Ζ|Η|Θ|Ι|Κ|Λ|Μ|Ν|Ξ|Ο|Π|Ρ|Σ|Τ|Υ|Φ|Χ|Ψ|Ω|α|β|γ|δ|ε|ζ|η|θ|ι|κ|λ|μ|ν|ξ|ο|π|ρ|σ|τ|υ|φ|χ|ψ|ω'); When I cat the file UTF char shows perfect however when i run... (1 Reply)
Discussion started by: varun22486
1 Replies

2. Shell Programming and Scripting

Copying the files to Windows server from UNIX server

Hi Team, I had a requirement to write a shell script which automatically transfer the files from unix server to windows server. I can able to unix to unix using Scp command. I am not sure how to do unix to windows. I am very new on this concept. Could you please help me or guide in... (4 Replies)
Discussion started by: gvkumar25
4 Replies

3. Linux

Help to Convert file from UNIX UTF-8 to Windows UTF-16

Hi, I have tried to convert a UTF-8 file to windows UTF-16 format file as below from unix machine unix2dos < testing.txt | iconv -f UTF-8 -t UTF-16 > out.txt and i am getting some chinese characters as below which l opened the converted file on windows machine. LANG=en_US.UTF-8... (3 Replies)
Discussion started by: phanidhar6039
3 Replies

4. UNIX for Dummies Questions & Answers

Copying files from Unix Server to Local

How to copy files from Unix server to Local (6 Replies)
Discussion started by: win4luv
6 Replies

5. UNIX for Dummies Questions & Answers

Copying files from Unix Server to Local

How do i copy files from Unix Server to my Local Desktop.. ANy ideas..please suggest....V Urgent. (1 Reply)
Discussion started by: win4luv
1 Replies

6. Shell Programming and Scripting

Error copying files from Unix (Solaris10) to Windows Server 2003 using scp/sftp

Hi, I have generated a Public/Private Key Pair in Solaris Unix (source) server and deployed the Public key in Windows 2003(target) server .ssh directory of user profile. When i try to connect(ssh, scp, sftp) from Unix, i'm getting below error message. Sun_SSH_1.1, SSH protocols 1.5/2.0,... (0 Replies)
Discussion started by: ajaykumarb
0 Replies

7. UNIX for Dummies Questions & Answers

Copying dir (and sub dir) file names from ftp server to txt file in diff server

Hey all, i want to copy only the file names from an ftp server (directory and all sub directory) to a text file in another server (non ftp), i.e. i want to recursively move through directories and copy only the names to a text file. any help is appreciated...thank you in advance (1 Reply)
Discussion started by: deking
1 Replies

8. Shell Programming and Scripting

writing script in UNIX for copying files in two server

can anyone help me in writing script in UNIX for copying files in two server from the third server after checking the files in the third server and if there is anything new in the third server automatically it should be added to the rest of the two servers and if same file is existing in the two... (4 Replies)
Discussion started by: REKHA09
4 Replies

9. UNIX for Dummies Questions & Answers

copying directories from NT server to Unix server (solaris 5.8)

I need to copy around 30 directories (each directory include one or more text file(s)) from NT server to Unix server at one go. For doing this what are the privillages i should have in both NT and Unix server. Please let me know which command i can use in shell prompt. TIA. (4 Replies)
Discussion started by: jhmr7
4 Replies

10. UNIX for Advanced & Expert Users

Copying files between 2 Unix server

Is there a simple way to copy data from one server to a different server? Seems that if 2 servers are on the same network, there should be a simple way to copy between the two. Not just one file. I need to copy a whole directory with subdirectories from one server to a different one. I... (9 Replies)
Discussion started by: Docboyeee
9 Replies
Login or Register to Ask a Question