From edi at agharta.de Fri Sep 8 09:38:55 2006 From: edi at agharta.de (Edi Weitz) Date: Fri, 08 Sep 2006 11:38:55 +0200 Subject: [html-template-devel] New version 0.5.0 Message-ID: ChangeLog: Version 0.5.0 2006-06-09 Added *FORMAT-NON-STRINGS* Download: http://weitz.de/files/html-template.tar.gz Cheers, Edi. From edi at agharta.de Thu Sep 14 14:07:37 2006 From: edi at agharta.de (Edi Weitz) Date: Thu, 14 Sep 2006 16:07:37 +0200 Subject: [html-template-devel] New version 0.6.0 Message-ID: ChangeLog: Version 0.6.0 2006-09-14 Changed default for *VALUE-ACCESS-FUNCTION* Added *STRING-MODIFIER* Added ESCAPE-xxx functions (from CL-WHO) Fixed docs for hyperdoc support General documentation enhancements Fixed test.lisp w.r.t. *FORMAT-NON-STRINGS* Download: http://weitz.de/files/html-template.tar.gz Note that some of the changes introduced in 0.5.0 and 0.6.0 make the library slightly incompatible with earlier versions. As there have been no bug fixes since 0.4.0, it is safe to stay with this version if you have code which you don't want to change. Cheers, Edi. From edi at agharta.de Fri Sep 29 20:40:53 2006 From: edi at agharta.de (Edi Weitz) Date: Fri, 29 Sep 2006 22:40:53 +0200 Subject: [html-template-devel] Re: Question about html-template In-Reply-To: (Jonathon McKitrick's message of "Fri, 29 Sep 2006 14:25:37 -0400") References: Message-ID: Hi! Please send follow-up questions to the mailing list. See Cc. On Fri, 29 Sep 2006 14:25:37 -0400, "Jonathon McKitrick" wrote: > I have a couple of templates with non-ascii encoding. Nothing > fancy, just copyright symbols, TM symbols, etc. But the non-ascii > character causes this: > > encoding error on stream # > (:EXTERNAL-FORMAT :LATIN-1): > the character with code 8226 cannot be encoded. > [Condition of type SB-INT:STREAM-ENCODING-ERROR] A transcript of what exactly you did would be very helpful. And maybe a backtrace. And maybe information about the Lisp implementation you're using. And maybe a self-contained test case which describes how one can reproduce the error, maybe with a small example file. http://www.chiark.greenend.org.uk/~sgtatham/bugs.html > Do you have any suggestions on how I can solve this? Other than > post-load modification of the page via javascript, which is really a > kludge? Did you try the EXTERNAL-FORMAT keyword argument of CREATE-TEMPLATE-PRINTER and FILL-AND-PRINT-TEMPLATE? Cheers, Edi. From jmckitrick at gmail.com Fri Sep 29 21:29:55 2006 From: jmckitrick at gmail.com (Jonathon McKitrick) Date: Fri, 29 Sep 2006 17:29:55 -0400 Subject: [html-template-devel] Fwd: Re: Re: Question about html-template In-Reply-To: References: Message-ID: Here is the footer for the html file I am serving as a template:
Copyright (c) 2006 Reed Larkey Group Inc.   ?   Website designed by Bartosz Brzezinski
Note the copyright symbol and the bullet. here is the code from the :get handler under araneida: (fill-and-print-template (pathname (concatenate 'string (araneida::static-file-pathname handler) (araneida::static-file-default-name handler))) nil :stream (request-stream request) :external-format :utf-8) )) It's plain and simple for now. No template vars, etc. I looked up 'with-open-file' and then 'open' to figure out what external-format types are valid, but the hyperspec said this was implementation specific. ATM, sbcl.org is down as well. I'm running sbcl 0.9.17 on an Intel Mac. > Did you try the EXTERNAL-FORMAT keyword argument of > CREATE-TEMPLATE-PRINTER and FILL-AND-PRINT-TEMPLATE? I added that to the example code above, but when I get the backtrace, you can see that EXTERNAL-FORMAT was LATIN-1, even though in 'create-template-printer' the same keyword arg is UTF-8, UNICODE, or whatever other value I pass in. -- Jonathon McKitrick Independent Software Consultant From edi at agharta.de Fri Sep 29 22:04:10 2006 From: edi at agharta.de (Edi Weitz) Date: Sat, 30 Sep 2006 00:04:10 +0200 Subject: [html-template-devel] Re: Question about html-template In-Reply-To: (Jonathon McKitrick's message of "Fri, 29 Sep 2006 17:25:39 -0400") References: Message-ID: On Fri, 29 Sep 2006 17:25:39 -0400, "Jonathon McKitrick" wrote: > I added that to the example code above, but when I get the > backtrace, you can see that EXTERNAL-FORMAT was LATIN-1, even though > in 'create-template-printer' the same keyword arg is UTF-8, UNICODE, > or whatever other value I pass in. No, I can't see it, because I didn't see a backtrace yet. Did you make sure that after changing the external format the template was really read again, i.e. did you clear the template cache? Besides, my /guess/ is that the error is signaled when you're writing to the Araneida stream - something one could probably see in the backtrace. Try to create a test case without Araneida, so you can be sure it doesn't affect the result. From edi at agharta.de Fri Sep 29 22:41:59 2006 From: edi at agharta.de (Edi Weitz) Date: Sat, 30 Sep 2006 00:41:59 +0200 Subject: [html-template-devel] New version 0.7.0 Message-ID: ChangeLog: Version 0.7.0 2006-09-30 Added TMPL_REPEAT Download: http://weitz.de/files/html-template.tar.gz Cheers, Edi. From jmckitrick at gmail.com Fri Sep 29 23:03:20 2006 From: jmckitrick at gmail.com (Jonathon McKitrick) Date: Fri, 29 Sep 2006 19:03:20 -0400 Subject: [html-template-devel] Re: Re: Question about html-template In-Reply-To: References: Message-ID: On 9/29/06, Edi Weitz wrote: > No, I can't see it, because I didn't see a backtrace yet. encoding error on stream # (:EXTERNAL-FORMAT :LATIN-1): the character with code 8226 cannot be encoded. [Condition of type SB-INT:STREAM-ENCODING-ERROR] Restarts: 0: [OUTPUT-NOTHING] Skip output of this character. 1: [ABORT-RESPONSE] Abort this response and answer another request 2: [ABORT] Exit debugger, returning to top level. Backtrace: 0: (SB-INT:STREAM-ENCODING-ERROR # 8226) 1: (SB-IMPL::STREAM-ENCODING-ERROR-AND-HANDLE # 8226) 2: (SB-IMPL::OUTPUT-BYTES/LATIN-1 # " --- html snipped ---
Copyright (c) 2006 Reed Larkey Group Inc.   ?   Website designed by Bartosz Brzezinski
" # :START 0 :END NIL) 6: ((LAMBDA (VALUES)) NIL) 7: ((SB-PCL::FAST-METHOD HTML-TEMPLATE:FILL-AND-PRINT-TEMPLATE (PATHNAME T)) # # #P"web/am01/index.html" NIL (:STREAM #)) 8: ((SB-PCL::FAST-METHOD ARANEIDA:HANDLE-REQUEST-RESPONSE (AJAX::MY-RLG-HANDLER (EQL :GET) T)) # #S(SB-PCL::FAST-METHOD-CALL :FUNCTION # :PV-CELL NIL :NEXT-METHOD-CALL #S(SB-PCL::FAST-METHOD-CALL :FUNCTION # :PV-CELL NIL :NEXT-METHOD-CALL NIL :ARG-INFO (3)) :ARG-INFO (3)) # :GET #) 9: ((SB-PCL::FAST-METHOD ARANEIDA:HANDLE-REQUEST (ARANEIDA:HANDLER T)) # # # #) 10: ((SB-PCL::FAST-METHOD ARANEIDA:HANDLE-REQUEST (ARANEIDA:HANDLER T)) # # # #) 11: ((LABELS ARANEIDA::DO-IT) # #) 12: (ARANEIDA::SERVE-EVENT-HTTP-LISTENER-ACCEPT-ONE-REQUEST #) 13: (SB-IMPL::SUB-SERVE-EVENT NIL 0) 14: (SB-SYS:WAIT-UNTIL-FD-USABLE 0 :INPUT NIL) 15: (SB-IMPL::REFILL-BUFFER/FD #) 16: (SB-IMPL::INPUT-CHAR/UTF-8 # NIL #:EOF-OBJECT) 17: (READ-CHAR # NIL #:EOF-OBJECT #) 18: (READ-CHAR # NIL #:EOF-OBJECT #) 19: (READ-PRESERVING-WHITESPACE # NIL (NIL) T) 20: (READ-PRESERVING-WHITESPACE # NIL (NIL) NIL) 21: (READ # NIL (NIL) NIL) 22: (SB-IMPL::REPL-READ-FORM-FUN # #) 23: (SB-IMPL::REPL-FUN NIL) 24: ((LAMBDA NIL)) 25: ((LAMBDA NIL)) 26: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #) 27: (SB-IMPL::TOPLEVEL-REPL NIL) 28: (SB-IMPL::TOPLEVEL-INIT) 29: ((LABELS SB-IMPL::RESTART-LISP)) > Besides, my /guess/ is that the error is signaled when you're writing > to the Araneida stream - something one could probably see in the > backtrace. Try to create a test case without Araneida, so you can be > sure it doesn't affect the result. Without araneida, the text of the file, including the special characters, prints ok to the slime output buffer, which is in utf-8 encoding. If that matters. -- Jonathon McKitrick Independent Software Consultant From edi at agharta.de Fri Sep 29 23:21:17 2006 From: edi at agharta.de (Edi Weitz) Date: Sat, 30 Sep 2006 01:21:17 +0200 Subject: [html-template-devel] Re: Question about html-template In-Reply-To: (Jonathon McKitrick's message of "Fri, 29 Sep 2006 19:03:20 -0400") References: Message-ID: On Fri, 29 Sep 2006 19:03:20 -0400, "Jonathon McKitrick" wrote: > encoding error on stream # This is the stream the error was signaled for. > 7: ((SB-PCL::FAST-METHOD HTML-TEMPLATE:FILL-AND-PRINT-TEMPLATE > (PATHNAME T)) # # > #P"web/am01/index.html" NIL (:STREAM # constant string" {128ACFB1}>)) This is the (Araneida) stream you gave as the STREAM keyword argument to FILL-AND-PRINT-TEMPLATE. They're obviously identical. So, you'll have to specify a fitting external format in Araneida. (Don't know how to do that.) > Without araneida, the text of the file, including the special > characters, prints ok to the slime output buffer, which is in utf-8 > encoding. If that matters. It confirms my guess that HTML-TEMPLATE has nothing to do with this problem. Cheers, Edi. From jmckitrick at gmail.com Sat Sep 30 01:06:16 2006 From: jmckitrick at gmail.com (Jonathon McKitrick) Date: Fri, 29 Sep 2006 21:06:16 -0400 Subject: [html-template-devel] Re: Question about html-template In-Reply-To: References: Message-ID: On 9/29/06, Edi Weitz wrote: > It confirms my guess that HTML-TEMPLATE has nothing to do with this > problem. Well, at least that narrows it down, thanks. The only reason I suspected html-template, is because araneida serves the exact same page without any problem when it is served as a regular static file. It must handle the cases differently. -- Jonathon McKitrick Independent Software Consultant