NetTalk Central

Author Topic: URL with special character do not get displayed  (Read 2941 times)

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
URL with special character do not get displayed
« on: September 12, 2018, 06:26:16 AM »
Hello Bruce and all others,

this files exists on my HDD
file:///G:/KiK_Braun_AD_Images/KiK_5_AD_AT_v2940/KiKSOAPServer/web/PDF/AT/Calciumgluconat B.Braun 10% Injektionsl?sung.pdf
and when typed into the address field of Edge, its gets fetch okay, however the URL itself has changed to
file:///G:/KiK_Braun_AD_Images/KiK_5_AD_AT_v2940/KiKSOAPServer/web/PDF/AT/Calciumgluconat%20B.Braun%2010%25%20Injektionsl?sung.pdf

No problem so far.

However, when I look up for
http://127.0.0.1:80/pdf/AT/Calciumgluconat B.Braun 10% Injektionsl?sung.pdf (that ? ought to be ö)
then Edges opens Bing, Firefox responds with a 404.

Others files, without % but with ?, get displayed. (that ? ought to be ö)

Kaliumchlorid B.Braun 74,5 mg/ml.pdf gets converted to and displayed okay like
http://127.0.0.1/pdf/AT/Kaliumchlorid%20B.Braun%2074,5%20mgml.pdf (note the / in mg/ml)
and also
http://127.0.0.1/pdf/AT/Kaliumchlorid B.Braun 74,5 mgml.pdf (note the / in mg/ml)

What might the reason and how could I fix this?

Would Stringtheory.URLDecode(..., ...) help? I just guess, because I do not understand what it is doing. But Decode sounds nice. <g>
Despite ist nice sounding name, it did not work the way I hoped, when I tried

st.setvalue(field)
st.URLDecode('%', '&#37;') ! hoping that % gets swapped with &#37;


Thanks in advance
Wolfgang
« Last Edit: September 12, 2018, 07:51:52 AM by Wolfgang Orth »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11171
    • View Profile

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
Re: URL with special character do not get displayed
« Reply #2 on: September 12, 2018, 11:12:56 PM »
try
http://127.0.0.1:80/pdf/AT/Calciumgluconat%20B.Braun%2010%25%20Injektionsl&ouml;sung.pdf

let me know what happens

The page cannot be found

The percent sign does not get resolved, it cunningly remained %25, the %20 however gets conerted to blank spaces.

http://127.0.0.1/pdf/AT/Calciumgluconat B.Braun 10%25 Injektionsl&ouml;sung.pdf

But when I manually replace the &ouml; with the appropriate character ? (which should read as an o with two dots on top), then it displays the PDF.

I continue fiddling.....

Follow up: st.Replace('%', '%25') makes it apparently working.

Thanks a lot, Bruce, I really really appriciate your help!
« Last Edit: September 12, 2018, 11:27:24 PM by Wolfgang Orth »