Sponsored Content
Top Forums Shell Programming and Scripting Cygwin vi XML file encoding problem Post 302439726 by royalibrahim on Friday 23rd of July 2010 11:46:52 AM
Old 07-23-2010
Cygwin vi XML file encoding problem

Hi,

I have got a zip (binary) file transferred from MacOS (thus it has additional __MACOSX directory packed inside). On extracting this zip, there are few *.xml files available. When I opened this *.xml file in vim editor using Cygwin (on windows) the editor displayed [Incomplete last line][converted] in the bottom. I tried command file command on this xml file gave me the result "Big-endian UTF-16 Unicode character data".

After google search I came to know Mac's line terminator is carriage return '\r'. So windows needs '\r\n' (carriage return + line feed). So I manually added this \n using sed command
Code:
sed -i 's/$/\r\n/' test.xml

After that I am seeing the output as:

Code:
þÿ^@<^@?^@x^@m^@l^@ ^@v^@e^@r^@s^@i^@o^@n^@=^@"^@1^@.^@0^@"^@ ^@e^@n^@c^@o^@d^@i^@n^@g^@=^@"^@U^@T^@F^@-^@8^@"^@?^@>^@^M

How to make this file a valid XML document?

Last edited by royalibrahim; 07-23-2010 at 12:52 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem printing the property of xml file via shell script

Hi, I have a config.xml which cointains the tags like <CONFIG> <PROPERTY name="port" value="1111"/> <PROPERTY name="dbname" value="ABCDE"/> <PROPERTY name="connectstring" value="xyz/pwd"/> </CONFIG> This file is in some directory at UNix box. I need to write a... (4 Replies)
Discussion started by: neeto
4 Replies

2. AIX

get the file encoding

Hello! The system is AIX 5.3 Give please command or script to get the file encoding (1 Reply)
Discussion started by: vinment
1 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

Encoding problem

Hi All, Hope you can help me with the below :). I'm working on a script on SUN solaris and I'm facing a problem with the number encoding as shown below, 1 is encoded to 31 (this is ASCII so it's ok) 11 is encoded as B118 !!! don't know why 111 is encoded as B1580C !!! don't know why ... (4 Replies)
Discussion started by: /dev/bag
4 Replies

5. Shell Programming and Scripting

How to achieve UTF-8 encoding & URL escape in an xml file?

Is there any i can achieve entity escaping, URL escaping & UTF-8 encoded for the xml generated through shell script? #! /bin/bash echo "<path>" >> file.xml for x in `ls filename*` do echo -e "\t<dir>" >> file.xml echo -e "\t\t<file>$x</file>" >> file.xml... (0 Replies)
Discussion started by: vel4ever
0 Replies

6. Programming

problem with accessing online XML file

Hi everyone, I am trying to access an online XML file, for example: <a href="http://www.rgraph.net/sample.xml" target="_blank">http://www.rgraph.net/sample.xml using HTML. <html> <body> <script type="text/javascript"> if (window.XMLHttpRequest) {// code for IE7+, Firefox,... (1 Reply)
Discussion started by: Xperia124
1 Replies

7. Shell Programming and Scripting

Xmllint - Xml-file problem --ods file not opening

Dear All, this is my first post on this Forum, glad to be here. I'm trying to fix an .ods file. Yes, I had a backup, but it's also corrupted. When opening the document I get this EM: read error format error discovered in the file in sub-document content.xml at 2,337040(row,col). So I... (3 Replies)
Discussion started by: jameslast
3 Replies

8. Shell Programming and Scripting

Use curl to send a static xml file using url encoding to a web page using pos

Hi I am try to use curl to send a static xml file using url encoding to a web page using post. This has to go through a particular port on our firewall as well. This is my first exposure to curl and am not having much success, so any help you can supply, or point me in the right direction would be... (1 Reply)
Discussion started by: Paul Walker
1 Replies

9. 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

10. Shell Programming and Scripting

How to know file encoding?

how can i know what format a file is * example: UTF-8 ANSI UCS2 i am in a... (8 Replies)
Discussion started by: tricampeon81
8 Replies
GOOGLE-SITEMAPGEN(1)					      General Commands Manual					      GOOGLE-SITEMAPGEN(1)

NAME
google-sitemapgen -- simple script to automate production of sitemaps for a webserver SYNOPSIS
google-sitemapgen [--testing] [--help] [--config=config.xml] DESCRIPTION
This manual page documents briefly the google-sitemapgen command. This manual page was written for the Debian distribution because the original program does not have a manual page. google-sitemapgen is a program that automatically produces sitemaps for a webserver, in the Google Sitemap Protocol (GSP). Sitemap files are XML listings of content you make available on your web server. The files can be directly submitted to search engines as hints for the search engine web crawlers as they index your web site. This can result in better coverage of your web content in search engine indices, and less of your bandwidth spent doing it. OPTIONS
--config=config.xml Specify the location of the configuration config.xml --testing Used to test the sitemap generator configuration. --help Display a summary of options and exit. SEE ALSO
/usr/share/doc/google-sitemapgen/examples/example_config.xml.gz AUTHOR
Google Sitemap was originally written by Google Code <opensource@google.com>. This manual page was written by Kumar Appaiah <akumar@ee.iitm.ac.in> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version pub- lished by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. GOOGLE-SITEMAPGEN(1)
All times are GMT -4. The time now is 09:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy