Just use `perl`. Sed is more complicated to use with newlines, but perl can handle them easily:
```
printf 'aa\r\nbb\r\ncc\r\n' > file
printf 'aa2\r\nbb2\r\ncc2\r\n' > file2
printf 'aa3\rbb3\rcc3\r' > file3
```
So, `file` has `\n` line endings, `file2` has `\r\n` and `file3` has `\r` (which is obsolete these days, by the way, not much point in supporting it). Now, concatenate them into a string:
```
$ joined_string_var=$(perl -pe 's/(\r\n|\r|\n)/; /g' file file2 file3)
$ echo "$joined_string_var"
aa; bb; cc; aa2; bb2; cc2; aa3; bb3; cc3;
```
You'll need a second pass to remove the trailing `; ` delimiter though:
```
$ joined_string_var=$(perl -pe 's/(\r\n|\r|\n)/; /g' file file2 file3 | sed 's/; $//')
$ echo "$joined_string_var"
aa; bb; cc; aa2; bb2; cc2; aa3; bb3; cc3
```
Or, remove it in perl:
```
$ joined_string_var=$(perl -ne 's/(\r\n|\r|\n)/; /g; $k.=$_; END{$k=~s/; $//; print $k}' file file2 file3)
$ echo "$joined_string_var"
aa; bb; cc; aa2; bb2; cc2; aa3; bb3; cc3
```