Hello every one,
I didn’t pay attention until recently, but I keep seeing the following warning while byte-compiling my preference files:
```
Warning: ‘string-as-unibyte’ is an obsolete function (as of 26.1); use ‘encode-coding-string’.
```
I use the following code to convert arbitrary text (usually utf-8, but may be something else):
```
(base64-encode-string
(string-as-unibyte (buffer-string))
'no-line-break)
```
I did look at the `encode-coding-string`, but what bother me is that it seems that I’m obliged to set the original `coding-system`. But in my case it can change from time to time.
Is there a way to keep the same "magical" behavior of `string-as-unibyte` function, with which I didn’t have to assume a possibly wrong source coding system? Am I correct if I say it’d be the `undecided` coding system? As in:
```
(base64-encode-string
(encode-coding-string (buffer-string) 'undecided)
'no-line-break)
```
As I’m reading the whole buffer content, is there a (local) variable holding the current buffer coding system?
Thank you very much!