Results 1 to 2 of 2

Thread: problem with php_java.dll

  1. #1

    Thread Starter
    Member n0vembr's Avatar
    Join Date
    Jun 2005
    Location
    pilipinas kong minumutya
    Posts
    60

    Question problem with php_java.dll

    hello there,
    ive been introduced to php_java.dll just recently and had it sucessfully call my java function. but i have a problem with the parameters it passes to the java method. apparently, there is no problem if the data is in normal text or numbers. however, if i try to pass a string in japanese characters it would read it as garbage characters(boxes)..is there any way i could resolve this? i really need to get the string in japanese characters also.. is there something like character-encoding that i need t set?

    i hope somebody could help me with my this...
    thanks..salamat..arigatou..gracias

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: problem with php_java.dll

    If I remember correct, Japanese characters would need to be in unicode right? PHP has no support for unicode strings, but that doesn't mean you cannot display unicode characters. In effect, a unicode stirng is a byte array, however, you require two bytes per character.

    So in theory, if you loop through your unicode string, extracting each two byte character , convert it to a an HTML enity and then output it, it should work:
    PHP Code:
    <?php
     
    // assign the stirng here - this is unicode ABC
    $unicode_string chr(1) . chr(255) . chr(0) . 'B' chr(0) . 'C';

    $len strlen($unicode_string);

    for(
    $x 0$x $len$x+=2) {
      
    $byte1 ord(substr($unicode_string$x1));
      
    $byte2 ord(substr($unicode_string$x+11));

      
    $unicode_character = ($byte1 << 8) | $byte2;

      echo(
    "&#$unicode_character;");
    }
    ?>
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width