From e05471a471167d1b53a5edbc5dddf950fc493c6a Mon Sep 17 00:00:00 2001 From: Peter Ohler Date: Fri, 10 Jan 2025 21:16:48 -0500 Subject: [PATCH] WIP --- ext/ox/parse.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/ox/parse.c b/ext/ox/parse.c index 04e5dd2..355cad7 100644 --- a/ext/ox/parse.c +++ b/ext/ox/parse.c @@ -342,6 +342,15 @@ static void read_instruction(PInfo pi) { } else { pi->pcb->instruct(pi, target, attrs.head, content_ptr); } + } else { + for (Attr a = attrs.head; a < attrs.tail; a++) { + if (0 == strcasecmp(a->name, "encoding")) { + strncpy(pi->options->encoding, a->value, sizeof(pi->options->encoding) - 1); + pi->options->encoding[sizeof(pi->options->encoding) - 1] = '\0'; + pi->options->rb_enc = rb_enc_find(a->value); + break; + } + } } attr_stack_cleanup(&attrs); if (content_ptr != content) {