Sponsored Content
Full Discussion: initial setup for iconv
Top Forums Shell Programming and Scripting initial setup for iconv Post 302529673 by sk1418 on Friday 10th of June 2011 03:29:07 AM
Old 06-10-2011
iconv changes the encoding, but not the content.
in your case, you could apply sed 'y/[allYourRussianLetters]/abcd...z/' command on all your 20-23 source files. to do the "translation"
 

9 More Discussions You Might Find Interesting

1. Programming

about iconv

I want to use iconv.h to convert some text to another charset. The code is below: #include <stdio.h> #include <stdlib.h> #include <iconv.h> int main() { iconv_t cd; char instr="汉字"; char *inbuf; char *outbuf; unsigned int insize=7; ... (4 Replies)
Discussion started by: yong
4 Replies

2. UNIX for Advanced & Expert Users

iconv and xmllint

Here is my question, volume of records processed : 5M ( approx ) Its basically very simple operation that am trying to do and I had achieved the output that am interested. What am looking for really is to improve the performance, an optimized way to do that. with respect to iconv, am... (3 Replies)
Discussion started by: matrixmadhan
3 Replies

3. AIX

AIX virtualization: IVM initial network setup

I have a system model 505 p server. I am trying to virtualize my server. My network admin has given me 10 IP addresses (with the DNS already updated with names that map onto each ip). E.g.: IP1 maps to m1.lab, IP2 maps to m2.lab, etc I have been following the redpaper "Integrated Virtualization... (0 Replies)
Discussion started by: apsaix
0 Replies

4. Shell Programming and Scripting

Help with iconv command

Hi , I am using iconv command to convert a file in UTF-16 format to UTF-8 format. This command will work for few files but for some showing an error as bad input character. But if i copy the contents of the file for which it is showing "bad input character" to a new file and perform the... (0 Replies)
Discussion started by: Shruthi8818
0 Replies

5. UNIX for Dummies Questions & Answers

Help with iconv command

Hi , I am using iconv command to convert a file in UTF-16 format to UTF-8 format. This command will work for few files but for some showing an error as bad input character. But if i copy the contents of the file for which it is showing "bad input character" to a new file and perform the... (2 Replies)
Discussion started by: Shruthi8818
2 Replies

6. AIX

GPFS initial setup, but perhaps this is a SAN/VIO question

I'm having some trouble getting a POC of GPFS up and running. I've read a couple install guides including a couple IBM pdfs but I'm getting stumped on something I think is fairly fundamental.... I'm trying to do this all on a single 795, right now only the VIOs have HBAs so all LUNs are pointed to... (3 Replies)
Discussion started by: kneemoe
3 Replies

7. Shell Programming and Scripting

Help with command iconv

I need to convert a utf16 file to utf8. When i use the iconv command to do so it gives an error saying invalid function. When I ran the iconv -l function it did not list the utf16 and utf8 as part of its internal table. Is there anyway I can add these encodings in the library? Is there any other... (3 Replies)
Discussion started by: gaun
3 Replies

8. IP Networking

DNS question about initial Master/Slave setup

Hey everyone. I'm creating a DNS master/slave server set up. I have the configurations all done I believe, the master has the required zone file, and the named.conf file has the allow transfer and allow query stuff set. The slave has it's own configs set. My question is that when initially... (1 Reply)
Discussion started by: Lost in Cyberia
1 Replies

9. UNIX for Advanced & Expert Users

Iconv on large files

Hi All, I am using iconv to convert huge files. the process is getting killed. I tried the option in below link https://www.unix.com/shell-programming-and-scripting/258825-iconv-large-files.html i.e iconv -f UCS-2 -t UTF-8 < inputfile.txt > outputfile.txt However, the process still gets... (4 Replies)
Discussion started by: tostay2003
4 Replies
ICONV(3)						   BSD Library Functions Manual 						  ICONV(3)

NAME
iconv_open, iconv_close, iconv -- codeset conversion functions LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <iconv.h> iconv_t iconv_open(const char *dstname, const char *srcname); int iconv_close(iconv_t cd); size_t iconv(iconv_t cd, const char ** restrict src, size_t * restrict srcleft, char ** restrict dst, size_t * restrict dstleft); DESCRIPTION
The iconv_open() function opens a converter from the codeset srcname to the codeset dstname and returns its descriptor. The iconv_close() function closes the specified converter cd. The iconv() function converts the string in the buffer *src of length *srcleft bytes and stores the converted string in the buffer *dst of size *dstleft bytes. After calling iconv(), the values pointed to by src, srcleft, dst, and dstleft are updated as follows: *src Pointer to the byte just after the last character fetched. *srcleft Number of remaining bytes in the source buffer. *dst Pointer to the byte just after the last character stored. *dstleft Number of remainder bytes in the destination buffer. If the string pointed to by *src contains a byte sequence which is not a valid character in the source codeset, the conversion stops just after the last successful conversion. If the output buffer is too small to store the converted character, the conversion also stops in the same way. In these cases, the values pointed to by src, srcleft, dst, and dstleft are updated to the state just after the last successful conversion. If the string pointed to by *src contains a character which is valid under the source codeset but can not be converted to the destination codeset, the character is replaced by an ``invalid character'' which depends on the destination codeset, e.g., '?', and the conversion is continued. iconv() returns the number of such ``invalid conversions''. If the source and/or destination codesets are stateful, iconv() places these into their initial state. There are two special cases of iconv(): 1. If both dst and *dst are non-NULL, iconv() stores the shift sequence for the destination switching to the initial state in the buffer pointed to by *dst. The buffer size is specified by the value pointed to by dstleft as above. iconv() will fail if the buffer is too small to store the shift sequence. 2. On the other hand, dst or *dst may be NULL. In this case, the shift sequence for the destination switching to the initial state is discarded. RETURN VALUES
Upon successful completion of iconv_open(), it returns a conversion descriptor. Otherwise, iconv_open() returns (iconv_t)-1 and sets errno to indicate the error. Upon successful completion of iconv_close(), it returns 0. Otherwise, iconv_close() returns -1 and sets errno to indicate the error. Upon successful completion of iconv(), it returns the number of ``invalid'' conversions. Otherwise, iconv() returns (size_t)-1 and sets errno to indicate the error. ERRORS
The iconv_open() function may cause an error in the following cases: [EINVAL] There is no converter specified by srcname and dstname. [ENOMEM] Memory is exhausted. The iconv_close() function may cause an error in the following case: [EBADF] The conversion descriptor specified by cd is invalid. The iconv() function may cause an error in the following cases: [E2BIG] The output buffer pointed to by *dst is too small to store the result string. [EBADF] The conversion descriptor specified by cd is invalid. [EILSEQ] The string pointed to by *src contains a byte sequence which does not describe a valid character of the source codeset. [EINVAL] The string pointed to by *src terminates with an incomplete character or shift sequence. SEE ALSO
iconv(1) STANDARDS
iconv_open(), iconv_close(), and iconv() conform to IEEE Std 1003.1-2001 (``POSIX.1''). BUGS
If iconv() is aborted due to the occurrence of some error, the ``invalid conversion'' count mentioned above is unfortunately lost. BSD
May 5, 2010 BSD
All times are GMT -4. The time now is 06:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy