0

I have blobs in a folder location and sometimes the blob name has some Chinese characters in it. For example, I have blob name as 项目.xlsx. Currently I am using downloadToFile method where am trying to download blob directly to my location. Here I couldn't specify UTF-8 encoding by any params or anything.

BlobClient blobClient = containerClient.getBlobClient(blobItem.getName());
blobClient.downloadToFile("C:/check/"+"项目.xlsx");

But in location if I give URL.encoder(项目.xlsx), its working fine, but I want the file name to be preserved. When I try to download, am getting unrecognized characters and marked with ? in the chinese characters file name.Is it possible by some way I can download the file to my local/azure file-share by having UTF-8 encoding so that Chinese characters are preserved? Please provide if any sample code is present.

8
  • You encountered a shortcoming of Windows … Commented May 27, 2024 at 10:14
  • 1
    Do you mean it is OS issue and not anything to related to azure blob storage? Commented May 27, 2024 at 10:17
  • 1
    When I try to download, am getting unrecognized characters and marked with ? in the chinese characters file name WHERE are you getting them? What does Windows Explorer say? Commented May 27, 2024 at 10:39
  • @antoclinton – Jepp! To verify that, try it on a Linux system. Or write a simple Java program that does nothing else than creating a file with the name 项目.xlsx and write some stuff to it. And there are differences between FAT (in all its incarnations) and NTFS. (Sorry, I do not have any Windows box at hand to try it myself) Commented May 27, 2024 at 14:36
  • 1
    @Venkatesan, you're somewhat repeating yourself, and inaccurately, as UTF-16 is used for file names afaik. It might be Ansi in certain limited areas Commented May 28, 2024 at 10:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.