AutoHotkey Community

It is currently May 27th, 2012, 6:14 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: November 11th, 2010, 10:55 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
this is a customized file for ahk_l saved with unicode's U+2028 lineseperator.
AHK_L does not detect it as newline (allthough AHK_L was used to create this file) and fails in execution as only one line is interpreted.

here's the creation script:
Code:
^t::
send var=this is a test{U+2028}msgbox `%var`%{U+2028}
return


which should result in this script
Code:
var=this is a test
msgbox %var%


the original file can be downloaded here:
http://www.autohotkey.net/~DerRaphael/t ... endian.ahk


as it seems for now that this U-2028 lineseperation and the U+2029 paragraph seperator will be upcoming standards to end that \r\n, \r, \n and \u0085 lineending story, imho ahk_l should be abled to support that natively. as for being prepared for future standards instead of hotfixing incorporations.

additionally if this ever gets fixed, ahk build in constants to easily send or create proper lineendings would be a nice to have, too ( see this wish )

greets
dR

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2010, 11:04 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
I'm sure there are countless programs that support only `r`n and/or `n, and will continue to do so. In particular, I think programming languages traditionally support only ASCII in source files outside of literal strings. I don't see the benefit in adding handling for yet another line ending. How many text editors will output that when you press Enter?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2010, 11:12 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
the w3c has been asked to officially support unicode endings within xml standards. since it makes perfect sense for xml data, there are some fractions which use ahk (and will continue using ahk_l) to modify xml files. so since u state that u dont see a benefit for including two more handlers for lineendings u put the burden to create own solutions on anybody who will have to work with xml files using unicode lineendings as commands such as fileappend, or fileread wont support it and therefore have to be replaced by totally custom routines. tough decision.

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2010, 12:58 am 
I see. That could be a problem for file-reading loops. Loop, Parse may need to be used instead.

However, the examples you have given are bad ones. FileAppend and FileRead don't do anything with line endings except (optionally) translate between `n and `r`n. There's no need to do that with Unicode line endings.

What does supporting Unicode line endings in XML entail? I didn't think whitespace had all that much meaning.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2010, 2:17 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
lexios wrote:
I didn't think whitespace had all that much meaning.
you are correct

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group