byby
V2EX  ›  问与答

请教一下 URL 编码

  •  
  •   byby · Apr 10, 2025 · 1184 views
    This topic created in 484 days ago, the information mentioned may be changed or developed.

    比如我有一个链接

    https://example.com/index.m3u8?para1=xxx&para2=yyy
    

    可以直接在浏览器里播放,如果把它封装成 dash 格式的 mpd 文件(本身是 xml ) 那么 url 里的&符号应该怎么处理?

    <BaseURL>https://example.com/index.m3u8?para1=xxx%26para2=yyy</BaseURL>
    

    还是

    <BaseURL>https://example.com/index.m3u8?para1=xxx&amp;para2=yyy</BaseURL>
    

    还是

    <BaseURL>https://example.com/index.m3u8?para1=xxx&para2=yyy</BaseURL>
    
    2 replies    2025-04-11 13:09:19 +08:00
    ysc3839
        1
    ysc3839  
       Apr 10, 2025 via Android
    第二种
    或者试试 CDATA
    julyclyde
        2
    julyclyde  
       Apr 11, 2025
    我觉得就是原文吧(第三种)
    没看出这里为什么需要 urlencode
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2789 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 05:42 · PVG 13:42 · LAX 22:42 · JFK 01:42
    ♥ Do have faith in what you're doing.