<commit_before>import React from 'react';
import { arrayToBinaryString } from 'proton-shared/lib/helpers/string';
import { mergeUint8Arrays } from '../../utils/array';

interface Props {
    contents?: Uint8Array[];
}

const TextPreview = ({ contents = [] }: Props) => {
    return (
        <div className="pd-file-preview-container">
            <div className="pd-file-preview-text">{arrayToBinaryString(mergeUint8Arrays(contents))}</div>
        </div>
    );
};

export default TextPreview;<commit_msg>[DRV-342] Fix unicode text preview<commit_after>import React from 'react';
import { mergeUint8Arrays } from '../../utils/array';

interface Props {
    contents?: Uint8Array[];
}

const TextPreview = ({ contents = [] }: Props) => {
    const string = new TextDecoder().decode(mergeUint8Arrays(contents));

    return (
        <div className="pd-file-preview-container">
            <div className="pd-file-preview-text">{string}</div>
        </div>
    );
};

export default TextPreview;
{'fraction_non_alphanumeric': 0.15963855421686746, 'fraction_numerical': 0.009036144578313253, 'mean_word_length': 3.5525114155251143, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7320789', 'n_tokens_mistral': 295, 'n_tokens_neox': 297, 'n_words': 61}