Here is the layout of the UK keyboard:
The apostrophe or single quote is between the semicolon ( ; ) and the octothorpe (#) so that should work.
You should not need any translation from UTF-8 (ubuntu native characterset) to ASCII
in ascii, apostrophe = hex 0x27 or dec 39
in utf-8, apostrophe = hex 0x27 or dec 39
If, for whatever reason, your apostrophe key is broken, you can enter the unicode directly:
Press and hold the Left Ctrl and Shift keys and hit the U key. You should see the underscored u under the cursor. Type then the Unicode code of the desired character and press Enter .
Another way is to use the charactermap from the menu.
If you really want to change the keyboardlayout, go to control-center and select 'keyboard'
There you can 'add' and 'delete' keyboardlayouts or define special keys under 'options'
One of those options is the possibility to define a 'compose key'
If what you need as apostrophe is not a single quote but a grave-symbol (not supported in ASCII) you can define a composekey in control center and then hold the composekey while typing a single quote twice.
If none of the above covers your usecase, then I urge you to provide much more detailed information regarding what you have done up to now, what you want exactly and what you actually get.