sanskrit-lexicon / csl-websanlexicon

1 stars 1 forks source link

webtc1 400 error #31

Closed funderburkjim closed 1 year ago

funderburkjim commented 1 year ago

A user (James H.) reported a problem with list display. While researching his problem, I noticed a probably related problem with the Cologne webtc1 display. Here is how the problem presents itself:

image
funderburkjim commented 1 year ago

This problem is quirky, because

funderburkjim commented 1 year ago

The above commit makes the problem go away for MD dictionary.

image
funderburkjim commented 1 year ago

The problem applies to all dictionaries.

So I reran redo_cologne_all.sh at Cologne for csl-websanlexicon/v02.

funderburkjim commented 1 year ago

The change idea

escape function in Javascript is deprecated when constructing urls with non-ascii characters (in our case, the utf-8 encoded Devanagari headword गुरु. Instead use encodeURI.

Solution suggested by Bing Chat (GPT)

The escape() function is deprecated and should not be used. Instead, you should use encodeURI() when you want to encode a URL. It encodes symbols that are not allowed in a URL. You should use encodeURIComponent() when you want to encode parameters of your URL. You can also use it to encode a whole URL12

Using both functions for security is not necessary since encodeURIComponent() already encodes all characters that have special meaning in URIs1

funderburkjim commented 1 year ago

I think this change (to encodeURI) was made. Closing issue.