One solution is to install a layout (or layouts) in the language that includes the diacritical characters you need, then switch the keyboard language on the fly. (Changing the language also affects the Terminal keyboard.) Or you could make your own, using the squeekboard layout guide (search the forum).
There is also the Characters app, with lots of symbols and extra emojis, as well as Character Map, with different symbols and letters. These are not as convenient to use as switching keyboards, but they provide some extra options.