You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it might be useful to have functions to encode and decode strings. If this functionality was to be added, it could take the format of .d<str><str> and .D<str><str>. The first argument is the string and the second argument is the encoding (taken from the standard encodings).
For example, to encode the input into cp1252, you would write .dQ"cp1252, and to decode the input intp cp1252 you would write .DQ"cp1252. Using the character k as the second argument would use the default encoding, UTF-8.
I think it might be useful to have functions to encode and decode strings. If this functionality was to be added, it could take the format of
.d<str><str>
and.D<str><str>
. The first argument is the string and the second argument is the encoding (taken from the standard encodings).For example, to encode the input into cp1252, you would write
.dQ"cp1252
, and to decode the input intp cp1252 you would write.DQ"cp1252
. Using the characterk
as the second argument would use the default encoding, UTF-8.So, to do this code golf with the python code:
you would write
.D.dQk"cp1252
.I know the feature is obscure, but I think it might be useful in creative string-based golfs.
The text was updated successfully, but these errors were encountered: