Unicodeには、Ⓐ、ⓐなどといったマル付きの英文字があるみたいなので、英文字列を入力するとマル付き文字に変換する簡単なスクリプトを作ってみました。というのを見かけたので、試しにGaucheで。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use srfi-13) | |
(use srfi-14) | |
(define (ab->maru str) | |
(string-map | |
(^c (let1 i (char->integer c) | |
(integer->char | |
(cond ((char-set-contains? #[a-z] c) | |
(+ (- i (char->integer #\a)) #x24d0)) | |
((char-set-contains? #[A-Z] c) | |
(+ (- i (char->integer #\A)) #x24b6)) | |
(else i))))) | |
str)) | |
(print (ab->maru "Masahide Maehara")) | |
;; => Ⓜⓐⓢⓐⓗⓘⓓⓔ Ⓜⓐⓔⓗⓐⓡⓐ |
0 件のコメント:
コメントを投稿