| Store | Cart

Re: How to create an xml file with XMLWriter that has 0A newlines in strings

From: Tod Harter <thar...@giantelectronicbrain.com>
Tue, 2 Jun 2015 13:01:40 -0500
UTF-8 and the containing of OD 0A (CRLF) are two separate issues, as these
characters exist as code points in UTF-8 (which is a superset of
US-ASCII/ISO-8860). So, handling the existence of CRLF is really your
business, you can pass ENCODING => 'utf-8', NEWLINES => 0 to
XML::Writer->new() to suppress any 'gratis' newlines, and tell the module
you want output to be utf-8 encoded. Beyond that the content is totally up
to you. I'd advise completely staying away from things like Notepad, it has
very little notion of how things are encoded or what sort of characters are
used, its really a terrible little program. If you STILL need to get rid of
some characters after you output the data from perl, then perhaps a 'one
liner' that simply strips away the offending characters would be the best
idea. Alternately if you insist on using a text editor use something like
TextPad++ that allows you to control line endings and encoding properly.

*“Men occasionally stumble over the truth, but most of them pick themselves
up and hurry off as if nothing had happened.” -*Winston Churchill

On Tue, Jun 2, 2015 at 9:14 AM, Nagy Tamas (TVI-GmbH) <
tama...@tvi-gmbh.de> wrote:

>  Hi,>>>> I have to create a special binary format that uses XML.>>>> I create an XML file with XMLWriter. After that I use Notepad++ to convert> it to UTF-8 file.>> The problem is, that also 0D 0A is written into the strings by Notepad++.>>>> How to delete the 0D-s from the strings after conversion? Many hex editors> support>> only overwriting. Which hex editor can delete it?>>>> Or how to create UTF-8 XML files with XMLWriter so that strings never> contain 0D 0A,>> just 0A.>>>> It seems to be impossible with perl XMLWriter.>>>> Visual Studio has a special XML format when a plugin is used. In this XML> format>> 0D 0A is everywhere in the XML except the strings, where there is only 0A.>>>> How is it possible to generate this file?>>>> Tamas Nagy>>>> _______________________________________________> Perl-XML mailing list> Perl...@listserv.ActiveState.com> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs>>

_______________________________________________
Perl-XML mailing list
Perl...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Recent Messages in this Thread
Nagy Tamas (TVI-GmbH) Jun 02, 2015 02:14 pm
Tod Harter Jun 02, 2015 06:01 pm
Nagy Tamas (TVI-GmbH) Jun 03, 2015 08:16 am
Tod Harter Jun 03, 2015 02:25 pm
Karl Billeter Jun 05, 2015 05:35 am
Nagy Tamas (TVI-GmbH) Jun 08, 2015 08:58 am
David Thomas Jun 08, 2015 02:53 pm
Shlomi Fish Jun 02, 2015 06:14 pm
Messages in this thread