Changeset 33642 in project


Ignore:
Timestamp:
09/11/16 18:56:52 (5 years ago)
Author:
sjamaan
Message:

Update packrat parser with workaround for srfi-14 being latin1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-generic/trunk/alternatives/uri-generic.packrat.scm

    r30967 r33642  
    295295;;
    296296
     297;; The SRFI-14 library uses Latin1, and its definition of "letter"
     298;; includes accented letters with high bit. This wreaks havoc with
     299;; UTF-8 URIs.  Besides, the RFC only discusses ASCII letters anyway.
     300(define char-set:ascii-letter
     301  (string->char-set
     302   "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))
     303
     304(define char-set:ascii-letter+digit
     305  (char-set-union char-set:ascii-letter char-set:digit))
     306
    297307(define char-set:uri-unreserved
    298   (char-set-union char-set:letter+digit (string->char-set "-_.~")))
     308  (char-set-union char-set:ascii-letter+digit (string->char-set "-_.~")))
    299309
    300310(define unreserved (char-set-parser char-set:uri-unreserved))
    301311
    302 (define alpha (char-set-parser char-set:letter))
     312(define alpha (char-set-parser char-set:ascii-letter))
    303313
    304314;; Turns a URI into a string.
Note: See TracChangeset for help on using the changeset viewer.