PoshGram icon indicating copy to clipboard operation
PoshGram copied to clipboard

Cyrillic file name

Open Shlepok opened this issue 5 years ago • 1 comments

Hello! When I try to send a file with cyrillic characters in name to telegram

$botToken = "xxxx"
$chat = "xxxx"
$file = "C:\абв г.txt"
$sendTelegramLocalDocumentSplat = @{
    BotToken            = $botToken
    ChatID              = $chat
    File                = $file
    Caption             = "Check out this file"
    ParseMode           = 'MarkdownV2'
    DisableNotification = $true
    Verbose             = $true
}
Send-TelegramLocalDocument @sendTelegramLocalDocumentSplat

I get the file with this name

= utf-8 B 0LDQsdCyINCzLnR4dA== =

There are no such problems with names in English or numbers.

Shlepok avatar Dec 09 '20 09:12 Shlepok

I have been able to reproduce this.

Unfortunately, I have yet to figure out how to solve it.

It seems that when Get-Item picks up the file it doesn't encode it in a way that honors the cyrillic characters.

I have tried various workarounds without success.

This may be more of a PowerShell limitation than a PoshGram limitation.

techthoughts2 avatar Apr 09 '21 19:04 techthoughts2