Special characters of POST - JSON - XHR

Hello.

I tried to send the JSON data via XHR POST. The XHR POST, I put a setRequestHeader as follows:

xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");

By default, this should work and it works, but if sending a chained JSON string as for example. What follows that it does not really:

xhr.send("data="+ JSON.stringify({"testData": "123", "msg": "&&&&"}));

Using the "&" rewritten and send in this way:

{"testData":"123","msg":"
:
:
:
"}

I also tried to use this request header:

xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8");

but because of CORS this does not have to serve.

All that I'm missing? I also tried with other values and special characters and the '&' is the problem here.

I got it working now with the following source has changed:

xhr.send("data="+ encodeURIComponent(JSON.stringify({"testData": "123", "msg": "&&&&"})));

For now it seems to work. I hope that that doesn't happen any other matter?

Tags: BlackBerry Developers

Similar Questions

  • JSON format - Date and special characters

    Hi all

    I had a JSON server in which, I have a few text values and date.

    1. How can I convert special characters to normal String.e.g. Comma etc. ?
    2. How can I convert long date, a string in the format e.g. "1345670466960-0400"?

    I really appreciate any help above.

    Solved... Where the above closure. For others, I will post the solution.

    Special characters-

    QByteArray buffer(bufSize, 0);
    int read = reply->read(buffer.data(), available);
    //response = QString(buffer); -- Wrong way to convert the bytes.
    response = QString::fromUtf8(buffer); // right way, so special character handled itself.
    

    Day fromatting - for example "/ Date (1345670466960-0400).

    QString getStringDate(QString k){
        QDateTime date = QDateTime::fromTime_t(getDate(k));
        QString strDate = date.toString("MM/dd/yyyy HH:mm:ss");
        return strDate;
    }
    long getDate(QString k) {
        long rc = 0;
        QString v = k;
        if (v.length() > 0 ) {
            int b = v.indexOf("/Date(");
            if (b >= 0) {
                b += 6;
                int e = v.indexOf(')', b);
                if (e > b) {
                    QString s = v.mid(b, e);
                    int sign = 1;
                    if (s.indexOf('-') > 0 || s.indexOf('+') > 0) {
                        sign = s.indexOf('-') > 0 ? -1 : 1;
                        e = sign < 0 ? s.indexOf('-') : s.indexOf('+');
                        s = s.mid(0, e);
                    }
                    bool *ok = false;
                    s = s.mid(0, s.length() - 3); //trimming it for seconds only....
                    rc = s.toLong(ok, 0);
                }
            }
        }
        return rc;
    }
    
  • Special characters: Angle symbol

    Hi, I am trying to find the symbol 'angle' commonly used in mathematics (two lines forming an angle of 45 degrees, an acute 'L')

    The answer previous (linked) says to do the following

    -Edit

    -Special characters

    -Math (etc.)

    However, this is an old post and now this option seems unavailable.

    Seems to be replaced by 'Emoji and symbols' However the closest I can find in this list is "⎳".

    I sincerely hope that I have not only lack. Thank you

    Execution of Yosemite 10.10.3

    angle geometry symbol, can it be typed? Which character keyboard or the police?

    Emoji & symbols is just a new name for special characters.

    Did you click on the toothed wheel and customize and add mathematical symbols?  I see ∠ to U + 2220.

  • Create these special characters in the name of the file as test.? docx or test? PDF in the OS window

    Hello

    Is there a possible way to create these special characters in the name of the file as test.? docx or test? PDF to test the goal?

    I do programming to detect this type of special characters in the file name. This modified script will this type of invalid char file appropriate name, so I need to have the sample to check if my script works.

    I have OSX or Linux. Is there no workaround solution I created in the window itself?

    or can someone create for me so I can go and download instead?

    Thank you and best regards,
    back4more

    Hi Backformore,

    Thanks for posting your question in the Microsoft answers Forum. For any question concerning the development of programs, visit the MSDN hereforums.

  • Special characters (characters sub) for base as Octal and hexadecimal number systems.

    I would like to add the characters void series of numbers to base such as the Octal and hexadecimal numbers. Is there a function that I can play with my keyboard to get these characters sub? Microsoft Office Word 2007 have only 0, 1, and 2 for base numbers.

    Hello Intrepid02,

    ·         What, exactly, are the special characters that you want to add?

    ·         You want to add them with Office 2007?

    If you want to add special characters with office, the question you have posted is related to Microsoft Office and would be better suited to the Microsoft Office community. Please visit the link below to find a community that will provide the support you want.

    http://www.Microsoft.com/Office/Community/en-us/default.mspx?DG=Microsoft.public.Office.misc&lang=en&CR=us

    Thank you

    Irfan H, Engineer Support Microsoft Answers. Visit our Microsoft answers feedback Forum and let us know what you think.

  • Special characters

    Hello

    I tried to display in a list of words that contain special characters, but I can only managed to get poster garbage when it comes to these characters. The groupdata assigned to the ListView contains data from an RSS feed that looks like:

    http://tr3sco.com/betas/BB10/news.XML

    Is it possible to encode special characters to display the correctly?

    P.D.: I use the QDomDocument to analyze the doc and the values are obtained with 'nodeValue();"that returns a QString

    Ive found the solution:

    When you download the info on the web and analysis with the QDomDocument of what it will work:

    QString to les(QString::fromUtf8(node1.nodeValue().toAscii()));)

    now, if you assign to a text box or label, it will show the accents...

  • xmlserialize with special characters

    Hello

    I am looking for a way to preserve special characters when using xmlserialize:

    When I run this query:

    Select xmlserialize (content xmltype('<Owner>Grand''co</Owner>').extract('/*') dash)

    Double;

    I get this result:

    < owner > big& apos; Co < / owner >

    I like to keep the "'" instead of having the "& apos;

    Does anyone have a solution?

    Thank you

    Martin

    Post edited by: Martin L.

    I don't have a problem but the xml code is downloaded from a Government website, and I don't know if they have properly managed these reserved characters. I don't know if they will save in their database of escape characters "" or they it will convert the reserved character.

    I don't think you need to worry about this.

    An XML parser must properly handle these characters and the corresponding predefined entity references.

  • remove special characters

    Hello

    How to remove special characters except '-'',' '. " in a string.

    Database: 10g

    Thank you

    Hello

    For example, use the REGEXP_REPLACE

    REGEXP_REPLACE (str

    , '[^-,.]'

    )

    I hope that answers your question.

    If this isn't the case, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.

    In the case of a DML (UPDATE), for example, the sample data should show what looks like the tables before the DML, and the results will be the content of the or the tables changed after the DML.

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

  • Special characters escaped HOWTO if you use regexp_replace and regexp_substr

    Hello experts,

    following test case

    insert into querytest1 (d) values

    ("#1 (170): [{'type': 'FACEBOOK', 'count': 0, 'Larry': 1382627403299}, {'type': 'GOOGLE', 'count': 0, 'Larry': 1381825285002}, {'type': 'EMAIL', 'count': 2, 'Larry': 1381826322925}] #2(0): #3 (5):-3141 #4 (5):-3141 #5 (5): 21804 #6: (7) 3890750 #7(3): s11'");

    Select regexp_replace (d, REGEXP_SUBSTR (REGEXP_SUBSTR (d, ' [^] +', 1, 1), "[^:] +' 1, 2"), ") of querytest1;

    ERROR on line 1:

    ORA-12726: unparalleled support in regular expression

    evidence that the characters special [] {} are the problem:

    delete from querytest1;

    commit;

    -Insert data without special characters

    insert into querytest1 (d) values (' #1 (170): 'type': 'FACEBOOK', 'count': 0, 'Larry': 1382627403299, 'type': 'GOOGLE', 'count': 0, 'Larry': 1381825285002, 'type': 'EMAIL', 'count': 2, 'Larry' [: 1381826322925] #2(0): #3 (5):-3141 #4 (5):-3141 #5 (5): 21804 #6: (7) 3890750 #7(3): s11');

    Select regexp_replace (d, REGEXP_SUBSTR (REGEXP_SUBSTR (d, ' [^] +', 1, 1), "[^:] +' 1, 2"), ") of querytest1;

    REGEXP_REPLACE (D, REGEXP_SUBSTR (REGEXP_SUBSTR(D,'[^]+',1,1),'[^:] +', 1, 2), ")

    --------------------------------------------------------------------------------------------------------------------

    [#1 (170): 'FACEBOOK', 'count': 0, 'Larry': 1382627403299,: 'GOOGLE', 'count': 0, 'Larry': 1381825285002,: 'EMAIL', 'count': 2, 'Larry': 1381826322925,: 'EMAIL', 'count': 2, "Lamarre": 1381826322925] #2(0): #3 (5):-3141 #4 (5):-3141 #5 (5): 21804 #6: (7) 3890750 #7 (3): s11

    so now it works because there is no characters [special])

    is there a way to escape them?

    Thank you in advance.

    Hello

    Since you are using Oracle 11.2, you can do it with a WITH recursive clause, like this:

    MERGE INTO dst t

    WITH THE HELP OF)

    MORPHING (q, result, n_to_do, start_pos, end_pos) AS

    (

    Q SELECT

    ,       d || ' ' AS a result

    REGEXP_COUNT (q

    , '#\d+\(\d+\):'

    ) AS n_to_do

    REGEXP_INSTR (q,

    , '#\d+\(\d+\):'

    1

    REGEXP_COUNT (q

    , '#\d+\(\d+\):'

    )

    ) AS start_pos

    LENGTH (q) AS end_pos

    T

    UNION ALL

    Q SELECT

    REPLACE (result

    , ':' || n_to_do | ' '

    , NVL (RTRIM (REGEXP_SUBSTR (SUBSTR (q, 1, end_pos))))

    , '#\d+\(\d+\):(.*)'

    start_pos

    1

    NULL

    1

    )

    )

    , 'NULL '.

    )

    ) AS a result

    , n_to_do - 1 AS n_to_do

    REGEXP_INSTR (q,

    , '#\d+\(\d+\):'

    1

    BIGGER (1

    , n_to_do - 1

    )

    ) AS start_pos

    REGEXP_INSTR (q,

    , '#\d+\(\d+\):'

    1

    n_to_do

    ) - 1 AS end_pos

    MORPHING

    WHERE n_to_do > 0

    )

    Q SELECT, result

    MORPHING

    WHERE n_to_do = 0

    ) CBC

    WE (dst.q = src.q)

    WHEN MATCHED THEN UPDATE

    SET dst.result = src.result

    ;

    You can have any number of rows in table t, but they must have a unique key.  I assumed q was unique, highest, but it can be a column or combination of columns.

    It works with any number of values.

    The character "#" can occur in the values, just that it does not part of the point of shells #-figures-leftparen-figures-rightparen-colon. If "#" occurs in this model, you can't simplify regular expressions, as John.

    The above solution was written for the table that you posted in response #6, where q contained values, and d was the formula with the holders of the place for values.  You seem that overthrew in your last message, you may need to reverse I used q and d.

    Whatever your problem, it seems to be a way very uncomfortable to solve.  You need to rethink your data model.  In particular, stroring data in delimited as q lists are a bad idea.  Relational databases work best when when each column contains a single value, not a list of any number of values.  It is so basic to the design of database he called first normal form.

    This would help a lot if post you more simple examples.  Instead of having 7 values, some close to 200 characters, you could show the problem just as well (better, in fact) with 3 or 4 values, no tha 10 don't characters each.

  • hexadecimal display special characters after 4.2 update

    After the update to 4.2 on the special characters of some items appear in hexadecimal notation

    German special characters - Aoussaou...--> u & CF #x;

    This only occurs in some applications in a workspace. Maybe the developer has used an unlikely way than the elements of filling via a url? The applications developed by seems to be normal.

    What is a migration problem or a problem of development?

    concerning
    Ralf


    ------
    http://old/pls/apex/f?p=123:502:776478184807008::NO:502:P502_STELLE_ID,F123_BEZEICHNUNG:113,113.2013%20-%20Jugendsozialarbeiter%20%2F%20Clubleiter%20-%20Jugendfreizeitzentrum%20S%C3%BCdclub%20F%C3%BCrstenwalde%20-%20Verein%20BSG%20Pneumant%20F%C3%BCrstenwalde%20e.V.

    113.2013 - Jugendsozialarbeiter / Clubleiter - Jugendfreizeitzentrum Sudclub Fürstenwalde - Verein BSG Pneumant Fürstenwalde e.V.

    http://new/pls/htmldb/f?p=123:502:29467084595368::NO:502:P502_STELLE_ID,F123_BEZEICHNUNG:113,113.2013%20-%20Jugendsozialarbeiter%20%2F%20Clubleiter%20-%20Jugendfreizeitzentrum%20S%C3%BCdclub%20F%C3%BCrstenwalde%20-%20Verein%20BSG%20Pneumant%20F%C3%BCrstenwalde%20e.V.

    113.2013 - Jugendsozialarbeiter & #x2F; Clubleiter - Jugendfreizeitzentrum S & #xFC; dclub F & #xFC; rstenwalde - Verein BSG Pneumant F & #xFC; rstenwalde e.V.
    (I inserted for example some areas between & _ #x2F; - or maybe the difference is not to be seen.)

    Hi Ralf,.

    is '113.2013 - Jugendsozialarbeiter & #x2F;. Clubleiter - S Jugendfreizeitzentrum & #xFC; dclub F & #xFC; rstenwalde - Verein BSG Pneumant F & #xFC; rstenwalde e.V.' the text of a link? Or is it posted somewhere else? It looks like a double exhaust system takes place.

    4.2 there is a new parameter called "HTML escaping Mode" which is by default the value 'Extended '. You can find it under "Edit Application Properties"-> security-> security of the browser. It may not be visible if 'Compatibility Mode' ('Change the properties of Application'-> 'Properties') is not defined > = 4.1. So, you'll need temporarily to 4.2 make visible this attribute.

    If you set it to 'Basic', you should be able to experience of the old behavior. But I think that we still have to examine why you have the double escapement.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Special characters when binding with word

    Hello world

    I have a problem with my project I hope there is an easy solution.

    I create a pre-existing some word documents WebHelp project and I'm linking them so it can all be updated more easily.

    My problem is that when the files are imported html files are named after the section titles, some of which have special characters such as '-', and '& '. Once uploaded to the Web server, files with special characters do not work and if they are clicked on in the table of contents provide a wicked big error indicating that the file does not exist (it adds the ASCII number in the file name). Cannot change the configuration of the server, so I need to make sure that the files have not all characters like that in them.

    Once imported, I'm not able to change the file by right click on the page name and go to properties and removing characters.

    Is there a way I can easily solve this problem without changing the titles in the word files?

    See you soon,.

    * Edit I use RH9

    Post edited by: leecare

    Search the model HLO of topic name. It is field you will see when you import and I think that should help you.

    See www.grainge.org for creating tips and RoboHelp

    @petergrainge

  • How to insert special characters

    Hey,.

    I can't understand how to insert special characters in a paragraph (the "Indent to Here" in this case).

    I tried text_frame.paragraphs [0] .silence += SpecialCharacters.INDENT_HERE_TAB;  but all I get is "1397319796" instead of the actual character.

    How to insert special characters instead of these numbers?

    Zoffix222 wrote:

    People who visit, but nobody don't know it?

    What, you mean that in the 5 minutes that you posted it responded to nobody? Shocking indeed.

    You already learned by yourself, 'content' is the wrong type of object stuff "SpecialCharacters' in. 'content' is the content of the text, translated in a simple string of Javascript. Only when you change a single 'character', you can use "SpecialCharacters", because at that time there Extendscript will see that you do not want to change the string "full"?

  • bidi-override for Leading zeros questions using causes out of special characters

    I use the below listed Tag to overcome the main question zeros and the looks of perfect pdf format and excellent format output. When the invoice number value is copied from excel to a Notepad file or anywhere, he adds a special character (square) before and after the value.

    < fo:bidi - substitute direction = "ltr" unicode-bidi = "bidi-override" > <? INVOICE_NUMBER? > < / fo:bidi - substitute >

    To avoid the above problem I tried to use the alternative in my SQL as method "=" "| invoice_number | » » ». This avoids issue zeros and special characters in Excel, but when the same report is presented in PDF output format it shows the = and quotes for the value.

    I tried to use <? XML version = "1.0" encoding = "UTF-8"? > and <? XML version = encoding "1.0" = "ISO-8859-15? > but no use.

    I read a lot of posts in this forum, but none has the solution.

    Anyone can guide me please?

    Maybe use different formats depending on the type of output file.

    If you use EBS under the competitor Manager, you can find the type of output to help file

    SELECT argument5 FROM fnd_conc_pp_actions WHERE concurrent_request_id = :p_conc_request_id AND action_type = 6
    

    You can add a similar logic to...

    
    
    

    Standalone BEEP, not sure but I am sure that it is possible to know what the output file type is too.

  • Special characters in the wrong Exif IFD0 (ImageDescription) export

    Someone at - it having problems with special characters such as a, o, u, e, to?

    I have a description of the image written to the IPTC section which Lightroom stores in EXIF too. Most GUI display the correct characters, but if you look at the Exif IFD0 part these characters are changed.

    In the example, you see that the 'u' is missing in 'Innsbrücke' below.

    Exif_IFD0.png

    You can see the original image here:

    http://www.Hirst.ch/content/09%20Ferien/2010%20-%20Adlerweg%20-%20Teil%202/2010%20-%20Adle rweg%20II%20-%20017.jpg

    The following link shows how the extracted tag of EXIF (ImageDescription) gets poster:

    http://www.Hirst.ch/#/content/09%20Ferien/2010%20-%20Adlerweg%20-%20Teil%202/2010%20-%20Ad lerweg%20II%20-%20017.jpg

    Just to show that there is nothing wrong with the GUI, check after the example (not exported Image with LR3) which work perfectly well:

    http://www.Hirst.ch/content/09%20Ferien/2008%20-%20Jordanien/2008%20-%20Jordanien%20-%2002 6. jpg

    http://www.Hirst.ch/#/content/09%20Ferien/2008%20-%20Jordanien/2008%20-%20Jordanien%20-%20 026 jpg

    Exif_IFD0_2.png

    Any help on getting these correct special characters in EXIF would be very much appreciated.

    Thank you

    It always resembles a UTF-8 conversion tank Latin problem.

    Honestly, most former EXIF fields are not going to be able to handle characters-international, but what is stored there, and what is displayed in the interfaces will be highly contextual.

    The plugin I mentioned can be used to standardize the metadata in order to minimize this problem.

  • How to handle special characters in the Apex

    Hello

    In my application, I have two regions - region report (interactive report) and other is region HTML with text elements two - Empno and name

    My report has two columns Empno (varchar2) and Ename (varchar2).

    When I click on the link change in the column of the report, the empno should be a read-only value EMPNO and ename is a text with the value of the ENAME field.

    When I run my application, I have encountered the following problems:
    1. If my empno has special characters such as "#", the characters after that is not posting
    2. If my empno has special characters such as "," characters after the decimal point is considered to be a value of next texitem

    Here is my authentication information,

    CTSAN_ORACLE_DB workspace
    Username [email protected]
    Password lakshmi321
    URL: http://apex.oracle.com/pls/apex/f?p=9444:19:4292839314890159:


    Please, I beg you. suggest me how to fix these problems.

    Thank you
    David...

    Published by: David on August 13, 2010 03:05

    Do not pass the data values in the URL. If it is possible to escape values to make URL - and APEX parameter-safe, it is much better to avoid the problem completely.

    Create a primary key of the substitution on the table which is an immutable discreet digital identifier and use it only as a URL parameter. In pages/target areas, use this value of PK to extract the data from the table.

Maybe you are looking for