tf.raw_ops.UnicodeEncode: Segmentation fault (core dumped)
Hi @nonenone12135 ,

Thanks for reporting. Replicated the reported issue. I am unsure why this check below is not worked.
https://github.com/tensorflow/tensorflow/blob/6f64ad5d767a034df45a5eaab8b36fd688cd1217/tensorflow/core/ops/string_ops.cc#L317

Will check and come back. Thanks! @vraebfdsb,
I tried to execute the mentioned code on tf-nightly and observed that the UnicodeEncode is executed without the Segmentation fault and the output error is as expected. Also the PR raised for the same has been merged. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/85e86643dc41cb3e81a091c566f33b31/untitled1952.ipynb).

https://github.com/tensorflow/tensorflow/pull/63398
Note: With tensorflow 2.15 and 2.16, the same Ops was failing with the Segmentation fault.
Thank you!
### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

binary

### TensorFlow version

tf 2.15

### Custom code

Yes

### OS platform and distribution

Ubuntu 20.04

### Mobile device

_No response_

### Python version

3.9

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Under specific input, `tf.raw_ops.UnicodeEncode` encounters "Segmentation fault (core dumped)".

### Standalone code to reproduce the issue

```shell
import tensorflow as tf

# Generate input data
input_values = tf.constant([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100])  # Unicode codepoints for "Hello World"
input_splits = tf.constant([[0, 5, 11]])  # Split indices for the input_values with two dimensions
output_encoding = "UTF-8"

# Invoke tf.raw_ops.unicode_encode
output = tf.raw_ops.UnicodeEncode(input_values=input_values, input_splits=input_splits, output_encoding=output_encoding)

# Print the output
print(output)
```


### Relevant log output

```shell
Segmentation fault (core dumped)
```
