Does anyone know if there is a function that converts URF-8 HEX characters included in search queries back to the original encoding, for example:
https://www.bambule.cz/vyhledavani/?search=hasi%C4%8Di+lego
%C4%D8 means letter č in my language. So the result should be a world hasiči. If there is any special character I need to convert.
Thanks a lot for your help.
I use Big query database system.
Use below approach
CREATE TEMP FUNCTION decode_url(encoded STRING)
RETURNS STRING
LANGUAGE js AS """
return decodeURIComponent(encoded);
""";
SELECT
url,
decode_url(REGEXP_EXTRACT(url, r'search=([^&]*)')) AS decoded_search
FROM your_data;
If to apply to your sample data
WITH your_data AS (
SELECT 'https://www.bambule.cz/vyhledavani/?search=hasi%C4%8Di+lego' AS url
)
the output is
2