minio / mc

Unix like utilities for object store
https://min.io/download
GNU Affero General Public License v3.0
2.88k stars 550 forks source link

mc find --metadata can't query Chinese #4997

Closed KirigiriSuzumiya closed 3 months ago

KirigiriSuzumiya commented 4 months ago

Expected behavior

# query Chinese value in metadata
mc find --metadata mykey=汉字 myhost

want to get correct object

Actual behavior

works well when query none-chinese value.

But returns nothing when value contains chinese

Steps to reproduce the behavior

I know that chinese is not supported in metadata, so I upload it in this way:

self.s3_cli.upload_file(file_path, self.config.bkt, key, 
                                    Callback=self.__callbackFunc,
                                    ExtraArgs={'Metadata': metadata})

while metadata is a dict(), generated by:

        out_dict = {k: urllib.parse.quote(v) for k, v in out_dict.items()}

after uploaded, Chinese is shown correctly at minio WebUI. but I can't query it using mc find --metedata

mc --version

romanchechyotkin commented 3 months ago

Hello, i put object with your key, then i did find command and i got it image image

KirigiriSuzumiya commented 3 months ago

Thanks for quick response! Maybe there is something getting wrong with terminal encoding format? BTW my terminal is in UTF-8, would you mind show me yours? Then I can have a try again. @romanchechyotkin

romanchechyotkin commented 3 months ago

The second screenshot, how you can see, my windows terminal cant print chinese characters, but anyway it works for finding objects with key where were those characters

KirigiriSuzumiya commented 3 months ago

this is my case, I have no idea what's going on.

2024-07-29_15-24

2024-07-29_15-25

klauspost commented 3 months ago

My best guess is that the values have different encoding and therefore doesn't match.

5006 runs both returned results and the regex through NFC normalization.