Office URI : To open a workbook with Chinese filename

谢天泽/Xie Tianze(Tiny) 5 Reputation points
2023-08-17T02:12:06.5666667+00:00

We're going to use "Office URI" to open a local office file (excel, word, ppt, etc) on webpage.

By clicking hyperlink, to open the files with local applications, not download them.User's image

Office URI is :

ms-excel:ofe|u|C:/users/username/documents/{filename}.xlsx

If there are some Chinese characters in filename or the route, it doesn't work,

because (I guess) the browser encode the URL so that Excel Application can't recognize the file, as the following img (sorry it's in Chinese):

User's image

What should I do to resolve this problem? Or it's totally impossible for Chinese or other character but english?

Thanks for your reply!

Thank you!

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,619 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,875 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,882 questions
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. David Chesnut 81 Reputation points Microsoft Employee
    2023-08-18T20:47:54.11+00:00

    Hi Xie, looks like this should work according to the Office URI schemes. Allowed characters are from RFC 3987. According to section 6.4 you want to be sure the URI string is UTF-8 encoded when you send it. Can you check to be sure it is using UTF-8 encoding?

    Thanks!

    David


  2. peiye zhu 165 Reputation points
    2023-08-26T02:09:01.8566667+00:00

    The webpage is encoded by UTF-8 I guess.But windows file system is using ASC2.So the file name can not be found on local files. In order to open local Excel file,please try to encode the web page with GBK or GB2312 rather than utf-8.


  3. pawornpat sgj 0 Reputation points
    2024-09-27T06:11:14.31+00:00

    Have you found a solution yet?

    Mine is the same but mine is in Thai.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.