%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/net/ |
Current File : //usr/local/share/emacs/27.2/lisp/net/puny.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; with all optimizations. ;;; This file contains utf-8 non-ASCII characters, ;;; and so cannot be loaded into Emacs 22 or earlier. (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (string-lessp emacs-version "23") (error "`%s' was compiled for Emacs 23 or later" #$)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'seq) #@103 Encode DOMAIN according to the IDNA/punycode algorithm. For instance, "fśf.org" => "xn--ff-2sa.org". (defalias 'puny-encode-domain #[(domain) "\301\302\"\203 \207\303\304\305\306\"\307#\207" [domain string-match "\\'[[:ascii:]]+\\'" mapconcat puny-encode-string split-string "[.]" "."] 5 (#$ . 424)]) #@148 Encode STRING according to the IDNA/punycode algorithm. This is used to encode non-ASCII domain names. For instance, "bücher" => "xn--bcher-kva". (defalias 'puny-encode-string #[(string) "\302\303\"\211GGU\203 \202# \304 \204 \305\202 \306P\307 G\"Q)\207" [string ascii seq-filter #[(char) "\301W\207" [char 128] 2] "xn--" "" "-" puny-encode-complex] 6 (#$ . 737)]) #@103 Decode DOMAIN according to the IDNA/punycode algorithm. For instance, "xn--ff-2sa.org" => "fśf.org". (defalias 'puny-decode-domain #[(domain) "\301\302\303\304\"\305#\207" [domain mapconcat puny-decode-string split-string "[.]" "."] 5 (#$ . 1121)]) #@84 Decode an IDNA/punycode-encoded string. For instance "xn--bcher-kva" => "bücher". (defalias 'puny-decode-string #[(string) "\301\302\"\203 \3031 \304\305\306\"!0\207\210\207\207" [string string-match "\\`xn--" (args-out-of-range) puny-decode-string-internal substring 4] 4 (#$ . 1378)]) (defconst puny-initial-n 128) (defconst puny-initial-bias 72) (defconst puny-base 36) (defconst puny-damp 700) (defconst puny-tmin 1) (defconst puny-tmax 26) (defconst puny-skew 28) (defalias 'puny-encode-digit #[(d) "\301W\203\n \302\\\207\303\301Z\\\207" [d 26 97 48] 3]) (defalias 'puny-adapt #[(delta num-points first-time) "\203\n \n\245\202 \306\245\307\211\211\f\245\\ Z _\306\245V\2032 Z\245 \\\202 ZT _ \n\\\245\\*\207" [first-time delta puny-damp k num-points puny-base 2 0 puny-tmin puny-tmax puny-skew] 5]) (defalias 'puny-encode-complex #[(insertion-points string) "\306 \n\307\211\211\211\f GW\2030\310\307\211T\211GW\203Z H\211Y\203+ \203S ^\202U \202+ ,\211 Z T_\\ \310\307T\211GW\203\"H\211W\203\232 T\fU\203z \307X\203\270 \202\315 \\Y\203\310 \202\315 ZY\203\311\312ZZ\"\\!\fB\fZZ\245\\\211\202\255 *\311!\fB\f\313 T \nU#\306 T \202z +TT\202 \f\237.\207" [puny-initial-n puny-initial-bias insertion-points q ijv m 0 nil -1 puny-encode-digit mod puny-adapt result h bias delta n string #1=#:--cl-vec-- #2=#:--cl-idx-- char #3=#:--cl-var-- #4=#:--cl-vec-- #5=#:--cl-idx-- puny-base k t1 puny-tmin puny-tmax] 9]) (defalias 'puny-decode-digit #[(cp) "\302X\203\f \303Z\304\\\207\305X\203 \306Z\207\307X\203 \310Z\207 \207" [cp puny-base 57 48 26 90 65 122 97] 2]) (defalias 'puny-decode-string-internal #[(string) "\306\307!rq\210\310\216 c\210\311\312\313\314#\203 `T\202 `d{\315\211\n\313`d|\210GW\203\330 \316\313\211\317H!T_\\X\203o \202\204 !\\Y\203 !\202\204 ZY\203\242 Z_\\\202J \320 T\321Z\f\315U#- \f\245\\\322\f\"eb\210u\210\323\324 \"c\210T\2020 .\325 +\207" [#1=#:temp-buffer string puny-initial-bias puny-initial-n out n generate-new-buffer " *temp*" #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] search-backward "-" nil move 0 1 puny-decode-digit buffer-size puny-adapt mod format "%c" buffer-string bias i ic encoded puny-base t1 digit k w old-i puny-tmin puny-tmax] 6]) #@274 Say whether STRING is "highly restrictive" in the Unicode IDNA sense. See http://www.unicode.org/reports/tr39/#Restriction_Level_Detection for details. The main idea is that if you're mixing scripts (like latin and cyrillic), you may confuse the user by using homographs. (defalias 'puny-highly-restrictive-string-p #[(string) "\302\303\304\305\306\"!\"\211G\307U\206 \310\311\312\313\314\"\")\207" [string scripts delq t seq-uniq seq-map #[(char) "\302>\203 \303\207 H\207" [char char-script-table (39 45 46 58 183 1418 1523 1524 3851 8204 8205 8208 8217 8231 12448 12539) t] 2] 1 seq-some identity mapcar #[(list) "\301\302\"\207" [scripts seq-every-p #[(script) " >\207" [script list] 2]] 3] ((latin han hiragana kana) (latin han bopomofo) (latin han hangul))] 7 (#$ . 3920)]) #@131 Say whether DOMAIN is "highly restrictive" in the Unicode IDNA sense. See `puny-highly-restrictive-string-p' for further details. (defalias 'puny-highly-restrictive-domain-p #[(domain) "\301\302\303\304\"\"\207" [domain seq-every-p puny-highly-restrictive-string-p split-string "[.]"] 5 (#$ . 4716)]) (provide 'puny)