Arabic encoding using Unix commands


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Arabic encoding using Unix commands
# 1  
Old 06-16-2013
Arabic encoding using Unix commands

I am using sed on Arabic file (utf-8 encoding) like bellow:
Code:
sed 's/./& /g' file

and all I get is:
Code:
1   ? ?   ? ? ? ? ? ? ? ? ? ?   ? ? ? ?   
? ? ? ? ? ?   ? ? ? ? ? ? ? ? ? ?

I tried change the LANG variable to
Code:
LANG=en_US.UTF-8

but I still get the same "?" output. What is the easiest way to change this without transliterating to English letters?

---------- Post updated at 10:54 AM ---------- Previous update was at 09:54 AM ----------

I solved it.
After setting LANG=en_US.UTF-8, just edit .profile and add these lines:
Code:
export LC_NUMERIC=C
export LC_ALL=C
export LESSCHARSET=utf-8
export LC_ALL=$LANG

# 2  
Old 06-16-2013
For this to work, you must have been piping the output of sed to less or to a file that you were then paging using less.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

View file encoding then change encoding.

Hi all!! I´m using command file -i myfile.xml to validate XML file encoding, but it is just saying regular file . I´m expecting / looking an output as UTF8 or ANSI / ASCII Is there command to display the files encoding? Thank you! (2 Replies)
Discussion started by: mrreds
2 Replies

2. HP-UX

install arabic lang

hi how to install arabic language and set it as default in hpux. also there is any website provide vm for hpunix for testing. (2 Replies)
Discussion started by: drpix
2 Replies

3. Shell Programming and Scripting

How to find the file encoding and updating the file encoding?

Hi, I am beginner to Unix. My requirement is to validate the encoding used in the incoming file(csv,txt).If it is encoded with UTF-8 format,then the file should remain as such otherwise i need to chnage the encoding to UTF-8. Please advice me how to proceed on this. (7 Replies)
Discussion started by: cnraja
7 Replies

4. Solaris

Arabic package in solaris

Hi, I have searched in all installation cds for arabic packages but couldn't find it. 1. Is there any other way to download arabic package? 2. Does we need to reboot the system after installing package? 3. I don't want to reboot the system so is there any service to restart to make the... (2 Replies)
Discussion started by: malikshahid85
2 Replies

5. Solaris

arabic setting in solaris

Hi, i have a file which show text on window like, insert into test values('اسيل للخدمات عبر الأثير'); but when i open this file in solaris it don't show like insert into test values('اسيل للخدمات عبر الأثير'); i also want to see the line same as it is on windows kindly help me (3 Replies)
Discussion started by: malikshahid85
3 Replies

6. UNIX for Dummies Questions & Answers

Arabic characters in QNX4

I want to display Arabic characters in QNX4. This work was been done by a colleague several years ago but he didn't document his work. I installed fonts and I got this display (attached). Please let me know how can correct as per the initial display were working in Arabic (attached). Thanks... (0 Replies)
Discussion started by: hbc
0 Replies

7. Solaris

Problem in Sending Arabic message in Unix

I have developed an application in java which sends arabic as well as english messages(SMS). First I deployed the same on windows machine and it sends the messages in both the languages. Due to some performance issue thought of migrating to UNIX. On the unix testing machine, when i tested it out,... (5 Replies)
Discussion started by: jacobkuncheria
5 Replies

8. UNIX for Dummies Questions & Answers

Encoding Problem while using "|" (PIPE) as delimiter from Mainframe to Unix

We are facing a problem with PIPE (|) as a delimiter in one of our FTP flat files. We are constructing a Flat file in IBM-AIX and this contains various strings delimted by PIPE Symbol and then FTPing this to a Mainframe System The Mainframe program simply recieves this and FTPs the same... (1 Reply)
Discussion started by: seshendra
1 Replies

9. UNIX for Dummies Questions & Answers

File encoding in Unix

1. I have a shell script which creates a file using cat command. How can i find what encoding the file follows (e.g. UTF8, ANSI)? 2. I want to convert that file to PC-ANSI format. How can i achieve that? I am using HP-Unix. (6 Replies)
Discussion started by: ssmallya
6 Replies

10. Solaris

no SOAP encoding under unix?

Under Unix however we had many many many many problems. We had to use Ansi2utf8(), repstr() and XMLval() to prevent "Invalid token" errors. And because we didn't know what the raw XML result was, it allways was a big problem to find the cause of it. (0 Replies)
Discussion started by: devotedsinner
0 Replies
Login or Register to Ask a Question