欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

关于Office中对%20的转义问题,请知道的大侠帮忙一起想想招儿!

发布时间:2025/7/25 编程问答 44 豆豆
生活随笔 收集整理的这篇文章主要介绍了 关于Office中对%20的转义问题,请知道的大侠帮忙一起想想招儿! 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

    在Excel或者Word中插入一个文件链接,如果文件名中有空格,一切正常,但是如果文件名中有"%20"这个子串,问题就来了,Excel和Word会把"%20"替换成空格,这下反而不对了!
    我试过将“%20”替换为“%2520”就像各种搜索引擎的作法一样,但是好像Excel/Word并没有象转义%20那样将%25转义为“%”字符,因此转化成URL的文件名成了abc%2520def.txt,难道Excel/Word只对%20转义,而忽略其它的HEX值??同是Office的Outlook就正常地按照预期效果转义了。

    也试过其它的转义符,如: / , // , \ , \\ ,% 等均没有效果。


    为了扩大问题被解决的可能性,将问题用英文recite如下:
    How to avoid the replacement of "%20" with " " in the filename linked by Excel/Word:
    Given a file named "abc%20def.txt"
1、 tried to substitute "%20" with "%2520" like most search engines do, but it seems that it doesn't work in Excel/Word, 'cause the filename comes out straightly as "abc%2520def.txt", while Outlook works properly to translate "abc%2520def.txt" to "abc%20def.txt". So I'm afraid that it may be a bug of MS Excel/Word not to translate substrings prefixed with '%' except "%20", or there may be an option to be set in Excel/Word ??

2、 we tried out the possible Escape Chars including / , // , \ , \\ , % , but in vain.

    Any suggestion? THX In Advance!

转载于:https://www.cnblogs.com/rexhost/archive/2005/01/05/86563.html

总结

以上是生活随笔为你收集整理的关于Office中对%20的转义问题,请知道的大侠帮忙一起想想招儿!的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。