JSON format - Date and special characters
Hi all
I had a JSON server in which, I have a few text values and date.
- How can I convert special characters to normal String.e.g. Comma etc. ?
- 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; }
Tags: BlackBerry Developers
Similar Questions
-
Remove the spaces and special characters to a form field
Hello
I am tragically new to all this, but I'm trying to create a form in Adobe Acrobat 9. I am trying to use a custom script Format to make entries in a form field and automatically remove the spaces and special characters (hyphens specifically). For example, if a user 'RAN - 99 06' entries I want to change it to "RAN9906." I found this script that does not allow users to input special characters
If (! event.willCommit) {}
Event.change = event.change.replace (/ [------$# ~ %------*------*------^-------------(\)------+=------[\]------{\}; \ "\ <>\ \?"]) \ | \\\ !] /g, "");}
And it's OK, but I can't understand how to prohibit the spaces. In addition, the perference would be a script to allow users to enter data as they wish, but to clean after leaving the text field.
Thanks in advance!
Yes, there are a few changes during the passage of the code of the event in the sequence of keys to the Validate event.
First of all, you need not try the willCommit. In fact, when the sequence of events of field reached the Validate event, the field is already committed. The Validate event does not therefore the property of willCommit.
Secondly, in the Validate event, you work on the event.value and either event.change. Thus, you will replace accordingly.
And who should actually do.
I hope this can help.
Max Wyss.
-
Problem with cfhtmltopdf and special characters
How can I fix cfhtmltopdf showing '? ' for special characters "1/2", "3/4", "•"? We have 11,0,07,296330 Standard in ColdFusion Server installed.
After further research and discussed with our system/DBA administrator, we suspected that he needed the CF11 Server JVM setting. We have added '-Dfile.encoding = utf8 "to java.args in ShadoMX/util/Flex/SDK/bin/jvm.config and special characters displayed correctly.
-
Remove the spaces and special characters.
Hi all
Here is the table of phone having a column that is 'phno' and the values are the below in this format.
I need given the output.
My client uses oracle 8i version.
EmplId
PhNO
output
121212
605/339-9276
6053399276
222222
251/813-0663
8132510663
323232
208-585-1594
2085851594
232323
352.735.8285
3527358285
Thank you
music
Hello
DEFINITION of use,
If it is possible to enumerate all special characters, do this way:
SELECT emplid, phno
REPLACE (phno
, '9 ./'
, '9'
), Exit
FROM table_x
;
If it is impossible, or if it is easier to display the characters that you want to keep, then do it like this
SELECT emplid, phno
REPLACE (phno
, '9 || TRANSLATE (phno
, ' ?' 0123456789
. '?'
)
, '9'
), Exit
FROM table_x
;
Whatever it is, the argument 3 of TRANSLATE is one of the characters that you want to keep (any), and the 2nd argument is that same character, followed by all the characters that you want to remove.
Nevermind, you use such an old version. Regular expressions are much easier.
This will leave 1 "at the beginning of '13527358285'. How to remove characters like this depends on means exactly what "characters like this. It can probably be done in Oracle 8 without too many problems, according to your needs.
-
Problem with Demo_Mail package sending an attachment and special characters
Hello
I did use the Demo_Mail package with the example in the http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html for many years on my 9i database.
Recently, we have taken a form that depends on this package and quickly found that Asian characters were not correctly in the e-mail subject or body. When I changed the procedure by example, characters came through, however, attachments now appear in the body of the email as ascii.
/*------------------------------------------------------start the email creation--------------------------------------------------------------------*/
Conn: = demo_mail.begin_mail)
sender = > from_name,.
recipient = > to_name,.
subject = > subject,.
mime_type = > "text/plain; charset = utf8');
() demo_mail.write_mb_text
Conn = > conn,.
message = > message | UTL_TCP. CRLF);
If file1 is not null
then
() demo_mail2.begin_attachment
Conn = > conn,.
mime_type = > ' application/octet-stream. "
Online = > FALSE,
v_filename = > file1.
transfer_enc = > 'base64');
file_len: = dbms_lob.getlength (wire);
modulo: = mod (file_len, TN);
parts: = trunc(file_len / amt);
/ * (dbms_lob.read (wire, amt, filepos, buf); * /)
While (counter < = pieces) LOOP
DBMS_LOB. Read (wire, amt, filepos, buf);
demo_mail.write_raw (conn, utl_encode.base64_encode (buf));
filepos: = counter * TN + 1;
counter: = counter + 1;
END LOOP;
/ * Point on the rest of the data buffer * /.
IF (modulo <>0) then
DBMS_LOB. Read (wire, modulo, filepos, buf);
demo_mail2.write_raw (conn, utl_encode.base64_encode (buf));
end if;
() demo_mail.end_attachment
Conn = > conn);
end if;
() demo_mail.end_mail
Conn = > conn);
/*------------------------------------------------------end the email creation--------------------------------------------------------------------*/
How can I have my cake and eat it too? Examples of scripts showing this scenario exist?
In addition, even if I was able to get the body of the email to display special characters, the subject line still displays question marks instead of the special characters. I was never able to solve this problem.
Any help to any of these questions is greatly appreciated!
Thank you
KimYou use the utl_encode.quoted_printable_encode before making all these changes? Most, if not all, of these accented characters must be converted to quoted printable form by the utl_encode.quoted_printable_encode function, then you only need to focus on the specific characters that must be encoded to the channel to cover additional expenditures for the mimeheader encoding. Specifically the white space characters should be encoded as well as the question mark.
Also, I have done some minor testing and it seems that the quoted_printable_encode function folds the text when it exceeds a specific length. If I unfold the coded text object lines seem to come by fine. The folding text string is an equal sign followed by the sequence CRLF, unfold the text is a simple matter of these three characters. These changes becomes the encoding routine encapsulated in a function:
create or replace function mimeheader_encode( p_str varchar2 , p_charset varchar2 := 'UTF-8') return varchar2 is l_str varchar2(2000); begin l_str:=utl_raw.cast_to_varchar2(utl_encode.quoted_printable_encode(utl_raw.cast_to_raw(p_str))); l_str:=replace(l_str,'='||chr(13)||chr(10),''); --unfold the data l_str:=replace(l_str,'?','=3f'); --quote question marks l_str:=replace(l_str,' ','=20'); --quote spaces l_str:='=?'||p_charset||'?Q?'||l_str||'?='; -- add prefix and suffix return l_str; end; /
-
Date.MinValue to format date and time in the MAF
Hello
For the amx:inputdate component, I want to display the date and time format. I need to be able to select the date and time.
Can someone help me please in obtaining it. If items available, please share me.
Thank you
Rita
If you just want to show the date or time, or both, then you change the attribute 'type' to date. MinValue
To date. MinValue on iOS, a native component selector is used for this purpose. On Android, there is a date component. MinValue AMX used.
You can check the link below for how it will look like
https://wikis.Oracle.com/display/ADFMobileDesign/component+-+input+date
-
How to search the data in special characters
Hi all
How to recover the data, if it has some special characters.
examples of data
It's like this. If I pass JOHN as keyword query should return all rows. I'm using the version of oracle 10g. Please let me know how to achieve this.NO Name 1 J-O-H-N 2 J*O*H*N 3 JOHN BOSCO 4 JOHN K
Kind regards
RajasekharYou can also use TRANSLATE to get rid of the unwanted characters:
SQL> with samples as (select 'J-O-H-N' c from dual union all 2 select 'J*O*H*N' c from dual union all 3 select 'J!O!H!N' c from dual union all 4 select 'JOHN BOSCO' c from dual union all 5 select 'JOHN K' c from dual 6 ) 7 select * 8 from samples 9 where upper(translate(c, 'X-*','X')) like '%JOHN%'; C ---------- J-O-H-N J*O*H*N JOHN BOSCO JOHN K
Note that I added a line to your test data which failed the test voluntarily.
-
Space and special characters in a header.
Hi all
I have a problem with the header of a report I want to generate by ODI.
I reproduce an old report which had the header of column, something like XXXXx YYYYY YYYYY.
If I put exactly the same header with spaces in ODI, he doesn't; then, I found a work around putting underscores (XXXX_YYYY_YYYYY).
It does not work to put the header between some special characters like or "because I already tried.
Is it possible to avoid the use of underscores?
Thank you
NotHello
I did a few test and to do what you need to customize some KM medium...
GOLD:
(1) create a file with the header in a procedure (or even as a stage KM).
You can use a simple procedure not as:
The OS command
the echo of MY header; COLUMN 1; COLUMN 2; > MY_TARGET_REPORT.txt
(2) run you interface with no header generation.
Make sense?
Published by: Cezar Santos 22/01/2009 13:10
-
We want to exclude the character of AppData\Roaming\test_*.doc or AppData\Roaming\Macromedia\Flash Flash #SharedObjects and we have added to the list of exclusions, but they keep ending upward in the repository. Other exclusions are working as expected. What we should expect?
If wildcards work, it would also be nice to be able to exclude AppData\Roaming\Mozilla\Firefox\Profiles\ * \minidumps
Hi Eric,.
Character does not currently support the use of wildcard characters in the configuration options. For example, "AppData\Roaming\test_*.doc" and "AppData\Roaming\Mozilla\Firefox\Profiles\ * \minidumps" will not work. However, I myself have tested 'AppData\Roaming\Macromedia\Flash Flash #SharedObjects' with 5.2 and it works very well. Please note that "Files and folders excluded from roaming" not delete all existing files in the remote folder. It simply prevents the files in the remote folder to be created in the local folder during logon, and it prevents any changes in the local folder from replication to the remote folder. This allows to turn off the setting and return the original data if you need to.
Please let me know if you have any other questions.
Thank you
Erik
-
Help XML and special characters
I am having trouble with the XML option with the feature "Generate help source" and the documentation tags. The problem seems to be that the CVI generates invalid XML files when there are some characters in the documentation tags. For example, it doesn't seem to work if I have a tag like this:
HIRET returns the output gain, in V/µm.
The issue seems to be with the Greek letter mu in the documentation comment. The resulting XML document seems to stifle most of the programs I try to use to read. HTML Help files seem to work well. I guess that one option would be to simply stick to A - Z, a - z, 0-9, etc., but I was wondering if there is something else that can be done.
Try the HTML ASCII code "µ" that might work in the XML standards.
-
UTF-8 encoding and special characters PROBLEM
Hello
I have attached a code: when I run this code, I see the french instead of french.
Can someone help me out here?
Thank you!!
Bert> Can someone help me out here?
> you said CF that your page is utf-8, is it?In fact (s) he did NOT SEE that the template is UTF - 8, which is the
problem.You told CF to expect form and URL in UTF - 8, you said it
to deliver UTF-8 in the browser and it said the browser that takes place is
UTF-8, but you didn't SEE to READ THE TEMPLATE in UTF-8 format.http://livedocs.Macromedia.com/ColdFusion/7/htmldocs/00000312.htm
--
Adam -
The libraries CC2015 and special characters.
I'm on Windows 8.1 and I have a PSD in my library which is only an image that I've resized in Photoshop, and when he was named "16:9" without the quotes I couldn't hang out in my calendar. However, when I renamed him "16 x 9" I could. I also had a file called "Hue/Saturation 1" without the quotes, and when I renamed him "Hue - Saturation 1" I could drag it to the timeline. " Is this a known problem can anyone else confirm this?
Colon and slash are Noo - Noo filenames under Windows. My guess is bringing the library into a sequence also brings it down from the cloud on your local hard drive, where it would need a file name.
-
GROUP BY does not work with games of different characters and special characters
Hello
I have a problem when you group by a column of text, databases with different character sets.
Database A: WE8ISO8859P15
Database b: WE8MSWIN1252
On two databases, I have a similar table with a text column (desc). DB, a, it's a type of tank, on DB B is nvarchar2. Two columns must contain the same text, but the last character is a point of inverted question mark ().
The strange thing is when I try to compare the columns according to the INTERNAL JOIN, the two columns are equal, but when I try to bring together this column, it seems they have different contents.
When I do a dump (ESCR) on the columns I get the question mark reversed on DB A ASCII Code 133, and DB B I get 191.
How do I convert between different character sets, so that my GROUP BY works as well?
Thanks for your help!
select * from (SELECT to_char(descA) AS desc1 FROM A WHERE ID=1)a INNER JOIN (SELECT descB AS desc2 FROM B WHERE ID=1) b ON a.desc1=b.desc2 WHERE a.desc1=bdesc2 --> 1 row (-->descA==descB) SELECT desc, count(*) (SELECT to_nchar(descA) desc FROM A WHERE ID=1 UNION ALL SELECT descB AS desc FROM B WHERE ID=1) GROUP BY desc --> 2 rows (can't group by desc --> descA!=descB)
try to use replace fuction, that converts a string to a character set to another.
http://www.techonthenet.com/Oracle/functions/convert.php -
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?
-
Hello friends,
My requirement is
I want to create a table. Presents some columns to display text.
so my question is,
What is the difference between a Standard report column and display text (escape special characters) in the attribute column property?
Kind regards
Arianne.
Hi ujwala1234,
ujwala1234 wrote:
Hello friends,
My requirement is
I want to create a table. Presents some columns to display text.
so my question is,
What is the difference between a Standard report column and display text (escape special characters) in the attribute column property?
Kind regards
Arianne.
Here is the difference:
- Standard report column: this is used when your column in the SQL query returns the HTML markup. For example the query SQL with APEX_ITEM API columns or columns where you have mixed data in the column with the markup. In short, APEX rendering engine treats the column as HTML markup and analysis accordingly to display the required HTML element.
- Display text (escape special characters): this type analysis the column data in the form of data stored in the database (no HTML). During analysis if the data contains special characters then it escapes and displays the data.
Yes, you can mix the manual in the form of built on APEX_ITEM with normal standard report (display text) columns.
I hope this helps!
Kind regards
Kiran
Maybe you are looking for
-
I have OSX Server 5.04. The App Store has said there is a free update to 5.1.5 However, the App Store is not updated my server after pressing the upgrade button. The little circle turns just in the upper left corner of the App Store next to the rig
-
WET610N not succeeded the DHCP
I have the job of bridge but I have to assign a static IP address for the above devices. I can't address an address on my DHCP server. Here's what I have: Cisco ASA5505 (firewall server & DHCP) WAP54G - Access Point WET610N - this wireless bridge Th
-
Need help, playback of Mp4 files on my Windows Vista system...
Could someone help me find how to view Mp4 files on my windows vista system. I downloaded files that are the mp4 file and whenever I open them with my Windows Media program, it gives me an error message. Help!
-
I have this on my computer. When I try to uninstall it from the Control Panel, he throws up a funny install wizard not the usual Microsoft Assistant. I have downloaded and run the Microsoft safety scanner but it is still there. Can anyone help.
-
10 windows and reinstalling Acrobat Pro XI
I recently upgraded to windows 10 and now I get the following message "the serial number you provided is valid, but calling it a product was not found on this computer." The drop-down list does not contain Acrobat Pro XI. How can I fix it? I don't