Jump to content
Ketarin forum

CarriageReturn and LineFeed fail to display correctly In Notes field, from Import XML


Nologic
 Share

Recommended Posts

http://www.mediafire.com/?fyr3r64w2chlqi4

 

Seems I'm butting my head against something all the time...always sucks to be the new guy.

 

Anyways I'm not seeing how come the linked file, fails to import correctly.

 

This is a cosmetic issue...but be nice to find out what I'm doing wrong...or if this is actually a bug or not.

 

Now if I copy all the text from the Notes field and paste it into a text editor then copy and paste back in...it displays more or less fine.

 

After Import:

 

snap1d.png

 

After Copy & Paste:

snap2g.png

Link to comment
Share on other sites

Are you sure they're carriage returns and line feed combinations (CRLF)? I would place money on it being LFCR or only LF or CR, which are not "native" Windows-based line terminators. Under Windows it should always be a CRLF combo, even though some applications allow you to save without this combination or to use content from OSes that use other formats.

 

What's the text editor you're using, and what are the line termination settings within it?

Link to comment
Share on other sites

Well I'm reading the innerhtml of an dom object, then cleaning it up.

 

AutoIt Code:

Func _CleanString( $String )
$String = StringStripWS( $String , 7 )
$String = StringReplace ( $String , @LF	 , '' )
$String = StringReplace ( $String , @CR	 , '' )
$String = StringReplace ( $String , '</p>'  , @CRLF & @CRLF )
$String = StringReplace ( $String , '</li>' , @CRLF )
$String = StringReplace ( $String , '<li>'  , ' - ' )
$String = StringRegExpReplace( $String , '(?s)(?i)(<.*?>)', '' )
; Ketarin Doesn't Like These
$String = StringReplace ( $String , '®'  , '' )
$String = StringReplace ( $String , '’'  , "'" )
$String = StringReplace ( $String , '“'  , '"' )
$String = StringReplace ( $String , '”'  , '"' )
$String = StringReplace ( $String , '—'  , '-' )
$String = StringReplace ( $String , '™'  , '' )
$String = StringReplace ( $String , 'Â'  , '' )
$String = StringReplace ( $String , '„'  , '' )
$String = StringReplace ( $String , '¢'  , '' )
Return $String
EndFunc

 

Grab the sample file off of MediaFire.

 

*Update*

updated link to newer build...and included source file & compiled exe of what I'm using to process FileHippo. Still need to add silent switches and such...but it's a nice start on things.

Link to comment
Share on other sites

Looked at it - no idea. The xml and CRLF are correct, and the corrected version (edited directly in the "notes" pane) is a binary match to the original. I can only guess that there's some form of field tagging in the back-end that ensures that the field is treated as a multiline box vs nowrap. Very odd. Definitely a bug.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.