Skip to content

Copying subtitles with diacritics unexpectedly strips spaces #101

@artjomsR

Description

@artjomsR

Environment

  1. OS name
    Windows 10, mpvacious_v0.23
    Describe the bug
    A description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Load subtitles with diacritics. Copy the subtitles either automatically or using Ctrl+C.
  2. Subtitles have spaces trimmed if string contains diacritics. So, "héllo héllo" becomes "héllohéllo"

Expected behavior
Subtitles are copied as-is

I can't seem to isolate where the problem lies. Individual components work correctly but collectively it doesn't work. A bat file outputs the content as expected:

@echo off
chcp 65001 >nul
echo héllo héllo|clip

I've also tried hardcoding the string and that produced strings with whitespaces correctly:

self.copy_to_clipboard = function(text)
    ...
    mp.commandv("run", "cmd.exe", "/d", "/c", string.format("@echo off & chcp 65001 >nul & echo %s|clip", "héllo héllo"))

I tried using set /p instead of echo but that didn't do anything

I've tried powershell but that didn't seem to work at all - it just flashes a terminal window without copying anything, maybe I didn't get the params quite right

Any suggestions would be appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions