+(defun riece-decode-coding-string-1 (string coding-system)
+ (let* ((decoded (decode-coding-string string coding-system))
+ (length (length decoded)))
+ (put-text-property 0 length 'riece-decoded-encoded-string
+ string decoded)
+ (put-text-property 0 length 'riece-decoded-coding-system
+ coding-system decoded)
+ decoded))
+
+;; The following functions are API used by handler functions. For the
+;; meantime DECODED is actually a string (with some text properties).
+;; In the future, however, the implementation _should_ be changed so
+;; that decoding phase is delayed until the body of handler functions.
+(defun riece-decoded-coding-system (decoded)
+ "Return the coding-system used for decoding DECODED."
+ (get-text-property 0 'riece-decoded-coding-system decoded))
+
+(defun riece-decoded-encoded-string (decoded)
+ "Return the string before decoding."
+ (get-text-property 0 'riece-decoded-encoded-string decoded))
+
+(defalias 'riece-decoded-string 'identity)
+