Results 1 to 5 of 5
Thread: Java and PHP4 ASCII
- 05-29-2010, 11:10 PM #1
Member
- Join Date
- May 2010
- Posts
- 2
- Rep Power
- 0
Java and PHP4 ASCII
Hi All
Currently I am developing a utility in Java, which needs to read a file, which is used in a PHP 4 application. This file is encrypted using a simple ASCII math and key encryption.
The Java application needs to read the file and return the same answer as the original PHP application, but on some characters it returns a different value. The PHP Application uses ord function, to convert a character into ASCII
Does anyone know how I could get the Java code, to return the same ASCII code?
Thanks
- 05-29-2010, 11:55 PM #2
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
- 06-01-2010, 11:07 AM #3
Member
- Join Date
- May 2010
- Posts
- 2
- Rep Power
- 0
Sorry about that.
An example of the character that returns a different ASCII value is Œ
The way I would convert the character in PHP would be
PHP returns 140Java Code:$keychar = “Œ” $iASCII = ord($keychar)
The way I would convert the character in Java would be
Java returns 338Java Code:Char cCharacter = “Œ” Int iASCII = cCharacter
Would anyone be able to tell me, how I can return the same ASCII value within Java?
Thanks
- 06-01-2010, 11:58 AM #4
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
- 06-01-2010, 02:38 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,604
- Blog Entries
- 7
- Rep Power
- 17
A nice read; here's another nice read; it's an old email conversation by Rob Pike (yep, that one) about the origins of utf-8.
kind regards,
Jos
Similar Threads
-
Binary and ASCII
By mac in forum New To JavaReplies: 4Last Post: 01-10-2010, 06:31 PM -
Reading ASCII / Unicode character in Java
By NGRaju in forum New To JavaReplies: 2Last Post: 09-16-2008, 10:02 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks