To replace all single quotes that are flanked by words with ¿ in a file (assuming bash is used, so that we may use $'...'):
q=$'\302\277'
sed "s/\>'\</$q/g" file
Alternatively
q=$( printf '\302\277' )
sed "s/\>'\</$q/g" file
or
sed "s/\>'\</¿/g" file
With the given input, this would produce
'gasg¿dhsh';'dhdjs'
The pattern \>'\< would match any ' that has a word character immediately before and after. The ; character and start/end of line are not word characters, while both g and d are.
Your code has three main issues:
A single quoted string in the shell may never contain a single quote. The embedded single quote in the call to gsub() will end the single quoted string that is the awk code, producing a syntax error.
Setting the input field separator to a single quote using -F "'" will cause awk to split the input on all single quotes. This means that the awk program will never see any single quotes, and your gsub() will therefore never replace anything.
The string \302\277 is not an inverted question mark, unless interpreted as an escape sequence.
Correcting all of these issues would make the program work, but it would replace all occurrences of single quotes:
$ awk -F ';' -v OFS=';' '{ for (i=1; i<=NF; ++i) gsub("'"'"'", sprintf("\302\277"), $i); print }' file
¿gasg¿dhsh¿;¿dhdjs¿
'as a delimiter, the data, once you parse it, will not contain any'.'in the argument togsub()will end the text of theawkprogram, since the program is single quoted.