Unicode turns into ? in W10 command line

image

using beets 1.4.6
python 3.6.5

I’ve tried using chcp 65001, set LANG=“C.UTF-8”, both to no avail. I don’t know if it makes a difference, but i’ve tried in native cmd, powershell, as well as cmder instances of both.

Since the issue seems to happen in the command line, it affects all beets commands.

The configuration of the Windows console is pretty hard to get right, I’ve heard! One way around it is to use our terminal_encoding setting to override the currently-configured locale and ask beets to force UTF-8 output.

Definitely seems to be the case. I checked my config and apparently I had already set terminal_encoding: utf8, which makes this even stranger. As expected, commenting it out didn’t help either.

I’m getting around importing by creating ascii folders around unicode subfolders, but for beet queries I’m stuck.

Huh! That’s strange. I don’t have a good explanation for why that config option wouldn’t do what it’s supposed to. Can you paste the output of beet config?

Thanks for looking into this!

C:\Users\Michael
λ beet config
directory: D:\cleanMusic
library: C:\mods\beets\musiclibrary.db

import:
    copy: yes
    write: yes
    log: beetslog.txt
    resume: ask

clutter:
- Thumbs.DB
- .DS_Store
- '*.m3u'
- .pls
ignore: [.*, '*~', System Volume Information]

match:
    preferred:
        countries:
        - JP
        - KR
        - TW
        - CN
        - HK
        - US
        - GB|UK
        media: [CD, Digital Media|File]
        original_year: yes

paths:
    default: $country/%the{$albumartist}/%if{$year,[$year%if{$month,.$month%if{$day,.$day}}] }$album%aunique{albumartist album year,albumtype label catalognum albumdisambig,[]}/%if{$multidisc,$disc-}$track $title
    singleton: $country/%the{$artist}/$title
    comp: $country/Compilations/%if{$year,[$year%if{$month,.$month%if{$day,.$day}}] }$album%aunique{albumartist album year,albumtype label catalognum albumdisambig,[]}/%if{$multidisc,$disc-}$track $title

replace:
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    \.$: ''
    \s+$: ''
    ^\s+: ''
    ^-: _
art_filename: cover
max_filename_length: 0
threaded: yes
timeout: 5.0
verbose: no
terminal_encoding: utf8

ui:
    color: yes

plugins:
- discogs
- lastgenre
- scrub
- missing
- duplicates
- bandcamp
- ftintitle
- mbsync
- fromfilename
- the
- inline
- chroma
- fetchart
- rewrite
pluginpath: []
item_fields:
    multidisc: 1 if disctotal > 1 else 0
chroma:
    auto: no
duplicates:
    checksum: no
    album: no
    copy: ''
    count: no
    delete: no
    format: ''
    full: no
    keys: []
    merge: no
    move: ''
    path: no
    tiebreak: {}
    strict: no
    tag: ''
discogs:
    user_token: REDACTED
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
fetchart:
    sources: filesystem coverart amazon albumart
    store_source: yes
    auto: yes
    minwidth: 0
    maxwidth: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
ftintitle:
    auto: yes
    drop: no
    format: feat. {0}
replaygain:
    backend: bs1770gain
    auto: yes
    overwrite: yes
scrub:
    auto: yes
bandcamp:
    source_weight: 0.5
    min_candidates: 5
    lyrics: no
    art: no
pathfields: {}
album_fields: {}
lastgenre:
    whitelist: yes
    min_weight: 10
    count: 1
    fallback:
    canonical: no
    source: album
    force: yes
    auto: yes
    separator: ', '
    prefer_specific: no
missing:
    count: no
    total: no
    album: no
rewrite: {}
the:
    the: yes
    a: yes
    format: '{0}, {1}'
    strip: no
    patterns: []

Hmm; everything looks fine here. Maybe it would be useful to try an alternative terminal app, like Cmder?