Skip to content

Wrong conversion of SJIS-encoded text files  #74

Description

@rikardow

Hi

Thanks for all the good work you do with this plugin

I've been trying to convert text (.txt) files encoded in SJIS and the conversion process doesn't report any problem but the result is incorrect

image

This is because LibreOffice doesn't support the conversion of SJIS files, but it can be solved from the PHP side by converting the contents of the file manually to UTF-8

$formats = ['ASCII', 'JIS', 'UTF-8', 'EUCJP-WIN', 'EUC-JP', 'SJIS-WIN', 'SJIS'];
$enc = mb_detect_encoding($content, $formats);
$utf8_content = mb_convert_encoding($content, 'UTF-8', $enc);

This allows LibreOffice to work as expected

test_sjis_short.txt this is a file encoded in SJIS, for testing purposes

Thanks for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions