Replace encoded characters in URL

Hi gurus,
I have the following requirement and I don't know how to solve it in the best way.
I have a Z transaction for uploading a local file. This file contains URL's and after upload, there are stored in SAP.
I need to check this URL and replace encoded characters with corresponding codes, for example: space -> %20
How can I do this? I've been looking for a solution, but I haven't found anything usefull yet.
Any ideas?
Thanks a lot!

Have a look at class CL_HTTP_UTILITY. There are some methods which looks promising.
The method ESCAPE_URL is waht you needed.
pass UNESCAPED = 'http://forums.sdn.sap.com/edit!default.jspa?messageID=11060123'
output = HTTP%3a%2f%2fFORUMS%2eSDN%2eSAP%2eCOM%2fEDIT%21DEFAULT%2eJSPA%3fMESSAGEID%3d11060123
& for vice versa use UNESCAPE_URL
Edited by: Keshav.T on Feb 7, 2012 2:23 PM

Similar Messages

  • Encoded characters in URL request string not decoded correctly

    When I make a GET request with the British Pound Symbol in one of the paramters, that parameter is either not there if the pound (%A3) sign is first, or truncated in my servlet. For Example:
              ValidateAmount.jsp?quantity=2&chargeAmount=%A312.2&chargeUnitType=R
              chargeAmount=null in above example
              ValidateAmount.jsp?quantity=2&chargeAmount=123-%A312.2&chargeUnitType=R
              chargeAmount=123- in the above example.
              When I look at the query string in the servlet, everything looks as it should, but I can't get the request parameters correctly.
              I have tried setting the Character Encoding to "UTF-8" in several places to no avail. I am using Weblogic 7.0 SP2 on a Windows 2000 machine. I am using Internet Explorer 6. How do I fix this?
              

    I cannot reproduce this using a test form I created: https://files.acrobat.com/a/preview/e6b390e1-625c-4f59-86c5-c2ca07998279
    Does the same thing happen with the form above?  If not, can you share your form with us: http://forums.adobe.com/thread/1408375

  • How to replace special characters in string.

    Hello,
    I want to replace special characters such as , or ; with any other character or " ".I find out there is no such function is java for this.There is only replace() but it accepts only chars.If anybody know how to do this?.
    Thanks,

    Hello,
    I want to replace special characters such as , or ;
    with any other character or " ".I find out there is no
    such function is java for this.There is only replace()
    but it accepts only chars.If anybody know how to do
    this?.
    Thanks,Can't you just do the following?
    public class Test
         public static void main(String[] args)
         String testString = "Hi, there?";
         System.out.println(testString.replace(',',' '));
    }

  • Can't CF use non English characters in URLs ???? (critical for SEO)

    Hi all,
    I want to use non English characters (Greek characters) for folders of the URLs.
    eg   http://www.mysite.com/Φάκελος/index.cfm
    where "Φάκελος" is a non English word (Greek).
    When the called page is simple HTML  eg   www.mysite.com/Φάκελος/index.HTM
    it's displayed just fine.
    When the called page is CF page  eg   www.mysite.com/Φάκελος/index.CFM
    I get a "FILE NOT FOUND" error.
    In the page where the link exists everything is UTF-8.
    What's the problem ? Can't CF use non English characters in URLs ????
    It's critical for SEO issues.
    I use CF9.  Any ideas ???
    Thanks in advance.
    Anastassios

    I don't have this setting in the email application. But as I know, html with Exchange is working only with the 2007 version, my server is still 2003 so I think in my case it's plain text only.
    But I'm telling again: good old (and now starting to miss) E60 with MfE worked very well!

  • [SOLVED] Problems opening folders with UTF-8 encoded characters

    Hello everyone, I'm having an issue when I acess folders in all my programs ( except Dolphin File Manager). Every time I open the folder navigation window in my programs, folders with UTF-8 encoded characters ( such as "ç", "á ", "ó", "í", etc ) are not shown or the folder name not show these characters, therefore, I can not open documents inside these folders.
    However, as you saw, I can type these characters normally. Here's my "locale.conf" :
    LANG="en_US.UTF-8:ISO-8859-1"
    LC_TIME="pt_BR.UTF-8:ISO-8859-1"
    And here's the output of the command "locale -a" :
    C
    en_US.utf8
    POSIX
    Last edited by regmoraes (2015-04-17 12:55:19)

    Thing is, when I run locale -a, I get
    $ locale -a
    C
    de_DE@euro
    de_DE.iso885915@euro
    de_DE.utf8
    en_US
    en_US.iso88591
    en_US.utf8
    ja_JP
    ja_JP.eucjp
    ja_JP.ujis
    ja_JP.utf8
    japanese
    japanese.euc
    POSIX
    So an entry for every locale I have uncommented in my locale.conf. Just making sure, by "following the steps in the beginner's guide", you also mean running locale-gen?
    Are those folders on a linux filesystem like ext4 or on a windows (ntfs?)

  • Looking for, and replace special characters

    Hi
    I am quite new to AppleScript and can't figure this out. Any help would be appreciated.
    I have received several (a lot of) folders containing images with some strange characters in the file names. The images has to go to web, and I want to replace those characters with some that are web friendly. The characters in question is some Swedish A's and O's (Ä, ä, Ö, ö) and one that looks like the Apple Command symbol. (I was told this one is a combination of a and e).
    Then, I would like to replace all spaces between the words in the file names with an underscore.
    In addition, all image file names start with capitals and I would like to replace these as well.
    Thanks
    Neal
    G5   Mac OS X (10.4.6)  

    Here's a modified version of the standard script:
    try
    tell application "Finder" to set the source_folder to (folder of the front window) as alias
    on error -- no open folder windows
    set the source_folder to path to desktop folder as alias
    end try
    display dialog "Search and replace in:" buttons {"File Names", "Folder Names", "Both"} default button 3
    set the search_parameter to the button returned of the result
    repeat
    display dialog "Enter text to find in the item names:" default answer "" buttons {"Cancel", "OK"} default button 2
    set the search_string to the text returned of the result
    if the search_string is not "" then exit repeat
    end repeat
    repeat
    display dialog "Enter replacement text:" default answer "" buttons {"Cancel", "OK"} default button 2
    set the replacement_string to the text returned of the result
    if the replacement_string contains ":" then
    beep
    display dialog "A file or folder name cannot contain a colon (:)." buttons {"Cancel", "OK"} default button 2
    else if the replacement_string contains "/" then
    beep
    display dialog "A file or folder name cannot contain a forward slash (/)." buttons {"Cancel", "OK"} default button 2
    else
    exit repeat
    end if
    end repeat
    display dialog "Replace “" & the search_string & "” with “" & the replacement_string & "” in every item name?" buttons {"Cancel", "OK"} default button 2
    tell application "Finder"
    set the item_list to every item of entire contents of source_folder
    tell me
    set item_list to reverse of the item_list
    end tell
    set source_folder to source_folder as string
    repeat with i from 1 to number of items in the item_list
    set the_name to name of item i of the item_list
    set this_item to item i of the item_list
    set this_info to properties of this_item
    set the current_name to the_name
    set change_flag to false
    repeat with this_char from 1 to (count items of search_string)
    if the current_name contains item this_char of (search_string) then
    if the search_parameter is "Folder Names" and ¬
    folder of this_info is true then
    set the change_flag to true
    else if the search_parameter is "File Names" and ¬
    folder of this_info is false then
    set the change_flag to true
    else if the search_parameter is "Both" then
    set the change_flag to true
    end if
    if the change_flag is true then
    set this_item to item i of the item_list
    -- replace target string using delimiters
    set AppleScript's text item delimiters to the item this_char of search_string
    set the textitemlist to every text item of the current_name
    set AppleScript's text item delimiters to the item this_char of replacement_string
    set the newitemname to the textitemlist as string
    set AppleScript's text item delimiters to ""
    set the current_name to newitemname
    end if
    end if
    end repeat
    my setitem_name(thisitem, current_name)
    end repeat
    end tell
    beep 2
    on setitem_name(thisitem, newitemname)
    tell application "Finder"
    --activate
    set the parentcontainerpath to (get the container of this_item) as text
    if not (exists item (the parentcontainerpath & newitemname)) then
    try
    set the name of this_item to newitemname
    return this_item
    on error the error_message number the error_number
    if the error_number is -59 then
    set the error_message to "This name contains improper characters, such as a colon (:)."
    else --the suggested name is too long
    set the error_message to error_message -- "The name is more than 31 characters long."
    end if
    --beep
    tell me to display dialog the error_message default answer newitemname buttons {"Cancel", "Skip", "OK"} default button 3
    copy the result as list to {newitemname, button_pressed}
    if the button_pressed is "Skip" then return 0
    my setitem_name(thisitem, newitemname)
    end try
    else --the name already exists
    --beep
    tell me to display dialog "This name is already taken, please rename." default answer newitemname buttons {"Cancel", "Skip", "OK"} default button 3
    copy the result as list to {newitemname, button_pressed}
    if the button_pressed is "Skip" then return 0
    my setitem_name(thisitem, newitemname)
    end if
    end tell
    end setitemname
    This script variant works by accepting a source string in the form "AB" and desired string "CD". When run, ABCA will become CDCC with the sample strings.
    (19254)

  • Find and Replace Japanese characters in pdf file on iPhone

    Hi eveybody !
    I want to find and replace Japanese characters in pdf on iPhone.
    I using zlib to deflate stream - endstream block and extract text.It's work fine with latin-text.
    But when i work with japanese characters , I don't know how to do it ?
    I decode a sample japanese pdf file, and I know that each Japanese characters are performances as hex string : "<01b7><0e230a23>..."
    But i don't know how to convert Japanese characters to the hex string like that.
    Can evrybody help me?
    Thanks!

    Searching is the same process as extracting - since it's about turning page content into something understandable.  So that still remains what you need to learn/understand - of course, referring back to all the previous sections about font formats, etc.
    Replacing in PDF is EXTREMELY DIFFICULT for two reasons - subset fonts and explicit glyph positioning.  Have you determine (conceptually, if nothing else) how you plan to addresses these two issues?
    PDF doesn't do UTF8 for page content - so don't worry about that.

  • Regular expressions-how to replace [ and ] characters from a string

    Hi,
    my input String is "sdf938 [98033]". Now from this given string, i would like to replace the characters occurring within square brackets to empty string, including the square brackets too.
    my output String needs to be "sdf938" in this case.. How should I do it using regular expressions? I tried several possible combinations but didn't get the expected results.

    "\\s*\\[[^\\]]+\\]"

  • Replacing 'special' characters

    Hi all,
    I was wondering if thers is a function module, class (method) or whatever (codepage translation) to convert 'special' characters like:
    è, é, ë, ï, etc with respectively e, e, e, i?
    More generally speaking we need to convert all characters (whether it be Unicode, Latin-1, etc.) to plain text containing only the letters of the alphabet from a-z and A-Z.
    Kind regards,
    Micky.

    @ Rainer,
    both thanks a lot for your relevant replies which are quite helpful. And I do think that we still needs some sort of intermediate table to hold at least some characters to be translated/converted into plain text.
    @ Gautham,
    I'm currently testing this function module with several codepages (parameter INTER_CP) beside the default codepage 1146. For characters like ë and ï this is definitely the way to go, but when using some characters that are really out there like ¥ŖßÞu0152u03A9u03C6, we still seem to be needing an intermediate table to replace these characters.
    But again, some very helpful answers.
    P.S. Although both answers are potentially worth 10 pts, It only seems fair to give you both the credit you deserve.

  • Replace multiple characters to single character

    Hi friends,
    I would like to replace multiple characters in a string to a single character. The character may be a pipe (|) or a tilde (~).
    For example "|||asdf||123|xyz||" should be changed to "asdf|123|xyz".
    I use Oracle 11g2.
    Thanks in advance!

    Without regexp
    with testdata as (
        select '||asdf||||123|xyz|' str from dual union all
        select 'asdf|123|||||||xyz||||' from dual union all
        select '||||||asdf|||123||||||xyz||||||' from dual
    select
    trim (both '|' from
        replace (
            replace (
                replace (str,'|','|'||chr(0))
                ,chr(0)||'|'
            ,chr(0)
    ) str
    from testdata
    STR
    "asdf|123|xyz"
    "asdf|123|xyz"
    "asdf|123|xyz"
    with regexp
    with testdata as (
        select '||asdf||||123|xyz|' str from dual union all
        select 'asdf|123|||||||xyz||||' from dual union all
        select '||||||asdf|||123||||||xyz||||||' from dual
    select
    trim (both '|' from
        regexp_replace (
            str
            ,'\|+'
            ,'|'
    ) str
    from testdata
    STR
    "asdf|123|xyz"
    "asdf|123|xyz"
    "asdf|123|xyz"
    Message was edited by: chris227 regexp added

  • Find/Replace nonprinting characters

    Hello,
    Is it possible to find and replace nonprinting characters in Pages? In particular, I want to replace all "hard" paragraph marks (i.e., return key) with newlines (shift-return), thus combining everything into the same paragraph for formatting purposes.
    I can't seem to paste any of these into the F&R window. I've tried a couple of things like ^r and \r, but it's not happening. Hitting the return key, of course, confirms the find, rather than placing the character in the box.
    Can anyone help? This is something I need to do fairly regularly.
    TIA,
    Jeff

    Hi Jeff,
    Select a paragraph mark.
    Menu > Edit > Find > Use Selection for Find
    Menu > Edit > Find > Find...
    Regards,
    Ian.

  • Vbscript to rename files and replace special characters

    Dear Exprt,
    would you please help to add addtional requirement for rename and replace special characters for file
    by the below script i can re name.
    strAnswer = InputBox("Please enter folder location to rename files:", _
        "File rename")
        strfilenm = InputBox("Enter name:", _
        "Rename Files")
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Sub visitFolder(folderVar)
        For Each fileToRename In folderVar.Files
            fileToRename.Name = strfilenm & fileToRename.Name
        Next
        For Each folderToVisit In folderVar.SubFolders
            visitFolder(folderToVisit)
        Next
    End Sub
    If FSO.FolderExists(strAnswer) Then
        visitFolder(FSO.getFolder(strAnswer))
    End If
    [email protected]

    Thx would you please look below what wrong in its run  nothing happend no error
    strAnswer = InputBox("Please enter folder location to rename files:", _
        "Test")
        strfilenm = InputBox("Enter name:", _
        "Rename Files")
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set regEx = New RegExp
    'Your pattern here
    Select Case tmpChar
    Case "&"
    changeTo = " and "
    Case "/"
    changeTo = "_"
    Case Else
    changeTo = " "
    End Select
    regEx.Pattern = tmpChar 
    Sub visitFolder(folderVar)
        For Each fileToRename In folderVar.Files
            fileToRename.Name = strfilenm & fileToRename.Name 
            fileToRename.Name = regEx.Replace(fileToRename.Name, tmpChar)
        Next
        For Each folderToVisit In folderVar.SubFolders
            visitFolder(folderToVisit)
        Next
    End Sub
    [email protected]

  • Encoding of UTF8 Characters in URL Strings

    I need to link to a URL that has a right single quotation mark in it (u+2019).
    This is it: "/News/Case-Studies/UNICEF-Headquarters’-Redesigned-Lobby-Space"
    When I paste the link in to a browser, it works.
    When I create a link with this URL as the href and click on it, it works.
    When I put it in a <CFLocation> tag, it does not work.  I need to make this work.
    When I take the URL from a browser address bar and paste it into a text editor, it converts the right single quote to the percent-encoded string "%E2%80%99".  I have not been able to recreate this encoding. URLEncodedFormat() yields a completely different string.
    When I parse the url and note the ASCii value of each character, I get three characters for the right single quote:  226 8634 8482.
    I came up with an encoding that worked, but resulted in special characters in the address bar of the browser (don't remember what the technique was at this point).
    What encoding can I perfrom at the CF server to duplicate the proper UTF8 encoded string of %E2%80%99?
    Any help would be appreciated.

    I appreciate your replies, but I'm still mystified.
    My user has pasted in a URL with a unicode single right quotation mark. I need to encode it as %E2%80%99.
    When I parse the single right quotation mark, I get three ascii bytes; chr(226) & chr(8364) & chr(8482)
    The first byte properly tells me that a three-byte unicode character is beginning (asc 226, or hex e2).
    I would think the next two bytes would be an asc 128 (hex 80) and an asc 153 (hex 99), which I could then easily convert to %E2%80%99, the proper sequence for a right single quotation mark..
    But the next two bytes report as different and significantly higher asc values (8364 and 8482).
    I don't see how I can possibly convert this properly.
    If I simply put a chr(8217) where the unicode character was, it works, but how on earth do I arrive at that?
    How do I get from chr(226) & chr(8364) & chr(8482) to chr(8217)?
    Still looking for ideas.  Thanks.

  • Dreamweaver still encodes special characters in URL - Bug?

    Dreamweaver 6 is still encoding my special characters when I enter a URL through the control panel AND hit enter. When I paste the link in code view or just paste it in the control panel Link field without hitting Enter, no formatting occurs.
    I have the setting under Code Rewriting in Preferences set to "Do not encode special characters", but regardless the reformatting occurs whenever I hit enter in the Link field in the Control Panel.
    For example:
    The link I'm pasting in is a dynamic one and is set to %%DC%%
    If I just paste the link into the control panel then click elsewhere the link is set and no formatting occurs. If I paste it in, then hit Enter the URL changes to %Ü%%
    Is this a bug or am I doing something incorrectly?

    I just tried it and it's happening in both.
    How it's occuring to me:
    - Open a new or old document.
    - Type in a random set of letters, highlight, then click inside in the Link field on the Control Panel
    - Type %%DC%%
    - Click off the random set of letters, and in code view the Link is still set to %%DC%% (so far so good)
    Now if you click back onto the random letters that are now linked, you'll see that the URL in the Link field now changes to %Ü%%, but the actual link in Code View remains %%DC%%.
    - Now click inside the link field in the control panel, but don't type or change the URL.
    - Click somewhere else to move the cursor out of the control panel
    - The link is now set to %Ü%% in both Code View and in the control panel

  • Passing values w/special characters in URL into an interactive report

    Hello,
    I have a problem and Ive been all over these forums and reading/trying everything I can to get something to work. I have a page that has a field called Name Search. The field is a TextField with autocomplete type. If I select a company name that contains special characters, like 'Blue Shield of California Life *&* Health Insurance Company', when I click go button (using a branch), it is supposed to pass this value into the URL to populate IR_COMPANY_NAME on the interactive report page to create the report filter. However, when it goes to the IR page, it actually filters on 'Blue Shield of California Life *& amp;* Health Insurance Company' with 'amp;' instead of & and doesnt find any matches. In the page source it is actually 'value="Blue Shield of California Life *& amp; amp ;* Health Insurance Company." Here is the URL that it produces:
    http://webtest2:7775/apex/f?p=102:IRCompanyList:995769774353901::NO:5,RIR:IR_COMPANY_NAME,P5_COMPANY_NAME:Blue%20Shield%20of%20California%20Life%20%26amp%3B%20Health%20Insurance%20Company,Blue%20Shield%20of%20California%20Life%20%26amp%3B%20Health%20Insurance%20Company
    The interesting thing is that I have another page that has a clasic report that lists all compnaies by name and the company_name is a link that passes the company name into the exact same IR and it works fine. In the page source it is value="Blue Shield of California Life *&amp;* Health Insurance Company" Here is the URL that this page produces:
    http://webtest2:7775/apex/f?p=102:5:995769774353901::NO:4,RIR:IR_COMPANY_NAME,P5_COMPANY_NAME:Blue%20Shield%20of%20California%20Life%20%26%20Health%20Insurance%20Company,Blue%20Shield%20of%20California%20Life%20%26%20Health%20Insurance%20Company
    I have modified every field involved changing between encoding, no encoding, changing display types (Standard Report Column, Remove HTML and escape special characters, etc). I have also attempted to encode the value myself prior to sending it to the next page. I have tried variations of the htf.escape_sc etc. I have also tried adding \&P2_COMPANY_NAME.\. I have also tried adding pl/sql to create a collection to store the values and then pl/sql to fill the values on the report page. It gives me the success message I setup, but it never actually fills the value.
    I am also having problems with another field that has a comma in it. I will wait to address that one to see if I can fix this first with hopes that it can be resolved by whatever I do to fix this issue.
    Any suggestions? I appreciate any feedback!
    Jen
    Edited by: J-Lig on Jul 13, 2012 10:20 AM
    Edited by: J-Lig on Jul 13, 2012 10:21 AM

    Thank you for your feedback!
    Yes, I forgot to mention that. It does come from a table, but company_name is not unique in that table. Meaning, it wouldnt know which ID to pass. Perhaps I should seperate the name out into another table and then I could pass the id. I was just hoping to get this to work programatically since the links from classic reports actually work correctly. I am starting to think this is a bug. This issue appears to have been addressed to make the links from reports pass the & correctly, but not in the branching?
    I have attempted to replace and then re-replace but I couldnt get it to work with IR_ fields as the filter fields are generated by the Interactive Report region. Do you have any insight working with those? Are there any tricks to it that I might be missing?

Maybe you are looking for