2 added 71 characters in body
source | link

C, 145145 144 bytes

Another C approach. Return by overwriting the input, using the fact that circumflex / breve are 2 bytes.

-1 bytes thanks to Steadybox.

i,t;f(char*s){for(t=1;*s;s++)if(*s^'x')for(i=12,t=1;i--;)t="cghjsuCGHJSU"[i]-*s?t:i*2;else t^1?memcpyt^1&&memcpy(s-1,"ĉĝĥĵŝŭĈĜĤĴŜŬ"+t,2),t=1:0;t=1;}

Try it online!Try it online!

C, 145 bytes

Another C approach. Return by overwriting the input, using the fact that circumflex / breve are 2 bytes.

i,t;f(char*s){for(t=1;*s;s++)if(*s^'x')for(i=12,t=1;i--;)t="cghjsuCGHJSU"[i]-*s?t:i*2;else t^1?memcpy(s-1,"ĉĝĥĵŝŭĈĜĤĴŜŬ"+t,2),t=1:0;}

Try it online!

C, 145 144 bytes

Another C approach. Return by overwriting the input, using the fact that circumflex / breve are 2 bytes.

-1 bytes thanks to Steadybox.

i,t;f(char*s){for(t=1;*s;s++)if(*s^'x')for(i=12,t=1;i--;)t="cghjsuCGHJSU"[i]-*s?t:i*2;else t^1&&memcpy(s-1,"ĉĝĥĵŝŭĈĜĤĴŜŬ"+t,2),t=1;}

Try it online!

1
source | link

C, 145 bytes

Another C approach. Return by overwriting the input, using the fact that circumflex / breve are 2 bytes.

i,t;f(char*s){for(t=1;*s;s++)if(*s^'x')for(i=12,t=1;i--;)t="cghjsuCGHJSU"[i]-*s?t:i*2;else t^1?memcpy(s-1,"ĉĝĥĵŝŭĈĜĤĴŜŬ"+t,2),t=1:0;}

Try it online!