Trying to convert utf-8 to WINDOWS-1251


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Trying to convert utf-8 to WINDOWS-1251
# 1  
Old 07-03-2014
Trying to convert utf-8 to WINDOWS-1251

Hello all
i have utf-8 file that i try to convert to WINDOWS-1251 on linux
without any success
the file name is utf-8 when i try to do :
Code:
file -bi test.txt

it gives me :
Code:
text/plain; charset=utf-8

when i try to convert the file i do :
Code:
/usr/bin/iconv -f UTF-8 -t WINDOWS-1251 test.txt > test2.txt

it gives me :
Code:
/usr/bin/iconv: illegal input sequence at position 0

where the first string in the file is :
Code:
1CClient

what im doing wrong here ?
# 2  
Old 07-03-2014
Please post hexdump or od of your file, abbreviated to some meaningful lines.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Convert files to UTF-8 on AIX 7.1

Dears, I have a shell script - working perfectly on Oracle Linux - that detects the encoding (the charset to be exact) of the files in a specified directory using the "file" command (The file command outputs the charset in Linux, but doesn't do that in AIX), then if the file isn't a UTF-8 text... (4 Replies)
Discussion started by: JeanM-1
4 Replies

2. Shell Programming and Scripting

Convert UTF-8 file to ASCII/ISO8859-1 OR replace characters

I am trying to develop a script which will work on a source UTF-8 file and perform one or more of the following It will accept the target encoding as an argument e.g. US-ASCII or ISO-8859-1, etc 1. It should replace all occurrences of characters outside target character set by " " (space) or... (3 Replies)
Discussion started by: hemkiran.s
3 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. Shell Programming and Scripting

Convert this Windows script so I can use it on Macbook

Hi guys, I am been banging my head for days on something that appears too simple to be so hard for me. I have this bash script which I used just fine on my windows PC. I took this file over to my Macbook and try to run it and it fails like no tomorrow. This is the contents of the file:... (3 Replies)
Discussion started by: richsark
3 Replies

5. Red Hat

Can't convert 7bit ASCII to UTF-8

Hello, I am trying to convert a 7bit ASCII file to UTF-8. I have used iconv before though it can't recognize it for some reason and says unknown file encoding. When I used ascii2uni package with different package, ./ascii2uni -a K -a I -a J -a X test_file > new_test_file It still... (2 Replies)
Discussion started by: rockf1bull
2 Replies

6. Shell Programming and Scripting

Convert Windows Metacharacters to Regular Text

Hi, all. I have a need to take a flat file FTP'd from Windows to Unix and convert it for loading into a MySQL database without manual intervention. However, some characters are "fancified" (e.g. the fancy Beginning and End double-quotes from Windows) that show up as codes using vi. I need to... (4 Replies)
Discussion started by: superdelic
4 Replies

7. Solaris

MySQL Authentication errror 1251 on Solaris.

I am trying to connect to MySQL installed on windows from Solaris machine. While doing this getting error as: "Client does not support authentication protocol requested by server; consider upgrading MySQL client; errno = 1251" I have installed mysql-5.1.34-solaris10-sparc.tar.gz on... (1 Reply)
Discussion started by: amit_27
1 Replies

8. UNIX for Advanced & Expert Users

Convert UTF-8 encoded hex value to a character

Hi, I have a non-ascii character (Ŵ), which can be represented in UTF-8 encoding as equivalent hex value (\xC5B4). Is there a function in unix to convert this hex value back to display the charcter ? (10 Replies)
Discussion started by: sumirmehta
10 Replies

9. Solaris

convert windows OS as Solaris remotely

I have a Windows 2000 Terminal, which I want to convert into Solaris 10. I am connected to windows terminal remotely via iLO and then inserted the solaris DVD in my local drive. Now when I connect to Windows machine from 'RDP' - I can see local DVD in there - and IF I then reboot remote machine... (1 Reply)
Discussion started by: panchpan
1 Replies

10. Programming

Howto convert Ascii -> UTF-8 & back C++

While working with russian text under FreeBSD&MySQL I need to convert a string from MySQL to the Unicode format. I've just started my way in C++ under FreeBSD , so please explain me how can I get ascii code of Char variable and also how can i get a character into variable with the specified ascii... (3 Replies)
Discussion started by: macron
3 Replies
Login or Register to Ask a Question