Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - xmftlg

#2
I also try to increase the newlisp stack like :



E:newlisp>newlisp -s 100000 test.lsp



E:newlisp>newlisp -s 1000000 test.lsp



but seems change nothing.
#3
Files in  attachment  are test.lsp b.txt c.txt



test.lsp:

(set 's (read-file "c.txt"))
(println (find-all {(?s)target=_blank>(?:(?!target=_blank>).)*?在线观看_百度视频}  s ) )

(exit
)


while b.txt and c.txt are actually html source code.



E:newlisp>newlisp

newLISP v.10.4.7 on Win32 IPv4/6 UTF-8 libffi, execute 'newlisp -h' for options.



> (load "test.lsp")



And newlisp terminated abnormal.

 

change in test.lsp:
(set 's (read-file "b.txt"))

E:newlisp>newlisp

newLISP v.10.4.7 on Win32 IPv4/6 UTF-8 libffi, execute 'newlisp -h' for options.





> (load "test.lsp")

("target=_blank>銆?em>鍟﹀暒鍟﹀痉鐜涜タ浜?/em>銆嬪姩婕紙2瀛e叏锛夐珮娓呭湪绾

胯鐪媉鐧惧害瑙嗛")



Now see the correct string.



in utf8 env the string is :

   ("target=_blank>《啦啦啦德玛西亚》动漫(2季全)高清在线观看_百度视频")  



Testing it in  v10.4.5 is the same result.



D:newlisp>newlisp

newLISP v.10.4.5 on Win32 IPv4/6 UTF-8 libffi, execute 'newlisp -h' for more inf

o.



> (load "test.lsp") ;;read c.txt



D:newlisp>newlisp

newLISP v.10.4.5 on Win32 IPv4/6 UTF-8 libffi, execute 'newlisp -h' for more inf

o.



> (load "test.lsp") ;;read b.txt

("target=_blank>銆?em>鍟﹀暒鍟﹀痉鐜涜タ浜?/em>銆嬪姩婕紙2瀛e叏锛夐珮娓呭湪绾

胯鐪媉鐧惧害瑙嗛")  



can anyone help?
#4
Thank you Lutz.

It works.



I should keep on learning  NEWLISP.



ps: found  in  google :



https://github.com/kosh04/newlisp.snippet/blob/master/net.lsp">https://github.com/kosh04/newlisp.snipp ... er/net.lsp">https://github.com/kosh04/newlisp.snippet/blob/master/net.lsp



;; URL translation of hex codes with dynamic replacement

(define (url-encode url (literal ""))

     (join (map (lambda (c)      

        (if (or (regex "[-A-Za-z0-9$_.+!*'(|),]" (char c))          

            (member (char c) literal))      

            (char c)            

           (format "%%%02X" c)))          

           ;; 8-bit clean    

        (unpack (dup "b" (length url)) url))))



haven't test  it.
#5
much thanks to  Lutz.



but in url:



 (url-encode "爱")



should be   %e7%88%b1



how to do that?
#6
newLISP v.10.4.5 on Win32 IPv4/6 UTF-8 libffi, execute 'newlisp -h' for more info.



(define (url-encode str)  

  (replace {([^a-zA-Z0-9])} str (format "%%%2X" (char $1)) 0))



(url-encode "倒")



ERR: invalid UTF8 string in function char。



need help.