impredicative / bitlyshortener

(discontinued)
https://pypi.org/project/bitlyshortener/
GNU Affero General Public License v3.0
26 stars 12 forks source link

[feature request] utf-8 support #4

Closed mkschulze closed 5 years ago

mkschulze commented 5 years ago

Not sure if the bit.ly API supports this, but it would be great to be able to generate URLs also from letters like [ä,ö,ü,§,%,"], so having utf-8 support would be nice.

impredicative commented 5 years ago

Do you mean for the short URL? In that case, no, it's not supported and probably never will be. The reason is that such fancy characters are more wasteful of bits and are therefore less efficient to store and to transmit. I agree though that the URL will look shorter.

Anyway, the nature of the short URL is beyond the scope of this package. I have no control over what they provide.

mkschulze commented 5 years ago

I mean like in my table example, when i want to shorten an URL with special characters.

The following examples mostly work, but some do not generate an URL. Those throw an error instead. I think supporting utf-8 encoding would be useful here.

Bad Request for url: https://api-ssl.bitly.com/v4/shorten

Bildschirmfoto 2019-05-06 um 21 39 51

here is the log from shortening this url http://127.0.0.1:5000/newrequest/%$§ https://gist.github.com/mark-schulze/4002e71525c799ed1930517fec0c8b7a

Or maybe it is a security issue passing certain symbols?

impredicative commented 5 years ago

Unicode characters in the long URL are not a problem; they are supported fine afaik. I believe it's the % sign that is the problem; it's problematic to use in a URL. I recommend avoiding the percentage sign. If you really want to use it, refer to the methods here but I recommend you don't.

mkschulze commented 5 years ago

Ok, I will validate it out then I guess. thx for the hint.

impredicative commented 5 years ago

Yes, let me know if there any other errors.