Sponsored Content
Full Discussion: iconv and xmllint
Top Forums UNIX for Advanced & Expert Users iconv and xmllint Post 302139424 by cbkihong on Saturday 6th of October 2007 12:53:05 PM
Old 10-06-2007
Yes, that's why it is good if you are doing validation and normally would expect everything to pass.

This shortcut will be quite messy otherwise, if indeed some records have problems. That's why I have another suggestion of using libiconv, as I know you can instruct it to ignore bytes that cannot be converted and proceed, and do so without stopping the iconv process. This cannot be achieved with the iconv executable alone because there are no "hooks" that allow you do so from the command line.

Loading of character tables is very expensive operation, so starting iconv many times is bound to be slow. If you really have records of that volume, you should really invest in a C program with libiconv that acts on a concatenated sequence of records. I have some good feeling that it could work based on my earlier exploration of libiconv although I have not made anything similar myself.
 

10 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. Shell Programming and Scripting

xmllint output to a file

Hello All, I have an XML file which has some errors in its tag definition according to an xsd. When i validate this xml file against an xsd, i wish to only take the errors in a file and not the complete xml. for eg. Raman.xml has some errors induced in it. RamanValidator.xsd holds the schema... (5 Replies)
Discussion started by: damansingh
5 Replies

3. Shell Programming and Scripting

XMLLINT COMMAND IN UNIX TO VALIDATE XML AGAINST XSD

Hi i am baby to unix shell script. how do i validate xml agaist xsd and transforms xml using xslt. Thanks Mohan (2 Replies)
Discussion started by: mohan.cheepu
2 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. UNIX for Dummies Questions & Answers

Xmllint pretty print, batch files

I have about 20 xml files I want to use xmllint to pretty print: xmllint --format file01.xml > pretty_file01.xml xmllint --format file02.xml > pretty_file02.xml etc Is there a way I can just use "xmllint --format" on all the current xml files so I don't have to run this command 20 times?? :( (5 Replies)
Discussion started by: pxalpine
5 Replies

7. Shell Programming and Scripting

Parse XML using xmllint

Hi All, Need help to parse the xml file in shell script using xmllint. Below is the sample xml file. <CARS> <AUDI> <Speed="45"/> <speed="55"/> <speed="75"/> <speed="95"/> </AUDI> <BMW> <Speed="30"/> <speed="75"/> <speed="120"/> <speed="135"/> </BMW>... (6 Replies)
Discussion started by: prasanna2166
6 Replies

8. Shell Programming and Scripting

Help with xmllint

Have like 50 xml files in a folder. They all have a Node named <Number>.How to display the values of <Number> with the count and filename in the folder. I am using Mac . (7 Replies)
Discussion started by: Anethar
7 Replies

9. Shell Programming and Scripting

Xmllint: get one result per line

Hi, I'm trying to get some values from an xmlfile and want be able to process them. I'm using xmllint(v20901 on debian jessie) and this program directly outputs all results concatenated right after each other. I did not find a solution in the man page to get a different format or some output... (2 Replies)
Discussion started by: stomp
2 Replies

10. Shell Programming and Scripting

Xmllint parser error : EntityRef: expecting ';'

Hi I have an XML file which contains html urls in that node values. When i use xmllint to parse that, i am getting error (because of the sympols in the url). i have used --html option but it throws other tag errors. Please guide me. sample file.xml <abc> <bcd> <cde> <a>sometext</a>... (2 Replies)
Discussion started by: ananan
2 Replies
ICONVCTL(3)						     Linux Programmer's Manual						       ICONVCTL(3)

NAME
iconvctl - control iconv behavior SYNOPSIS
#include <iconv.h> int iconvctl (iconv_t cd , int request, void * argument); DESCRIPTION
The argument cd must be a conversion descriptor created using the function iconv_open. iconvctl queries or adjusts the behavior of the iconv function, when invoked with the specified conversion descriptor, depending on the request value. REQUEST VALUES
The following are permissible values for the request parameter. ICONV_TRIVIALP argument should be an int * which will receive 1 if the conversion is trivial, or 0 otherwise. ICONV_GET_TRANSLITERATE argument should be an int * which will receive 1 if transliteration is enabled in the conversion, or 0 otherwise. ICONV_SET_TRANSLITERATE argument should be a const int *, pointing to an int value. A non-zero value is used to enable transliteration in the conversion. A zero value disables it. ICONV_GET_DISCARD_ILSEQ argument should be an int * which will receive 1 if "illegal sequence discard and continue" is enabled in the conversion, or 0 oth- erwise. ICONV_SET_DISCARD_ILSEQ argument should be a const int *, pointing to an int value. A non-zero value is used to enable "illegal sequence discard and con- tinue" in the conversion. A zero value disables it. RETURN VALUE
The iconvctl function returns 0 if it succeeds. In case of error, it sets errno and returns -1. ERRORS
The following errors can occur, among others: EINVAL The request is invalid. CONFORMING TO
This function is implemented only in GNU libiconv and not in other iconv implementations. It is not backed by a standard. You can test for its presence through (_LIBICONV_VERSION >= 0x0108). SEE ALSO
iconv_open(3), iconv(3) GNU
February 2, 2004 ICONVCTL(3)
All times are GMT -4. The time now is 02:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy