Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2006
    Location
    Oslo, Norway
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question multi-byte format

    Hey!

    I need to convert å plaintext string into a multi-byte storage format. The ASCII characters have should have the high byte set to 0x00.

    How to do this in PHP? Any suggestions?

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    utf8_encode()

    Note: this is to convert from ISO-8859-1 to UTF-8. If you need to convert from another charset, use recode_string() or iconv(). Personally, I recommend iconv() if you require a function beyond utf8_encode().
    "$question = ( to() ) ? be() : ~be();"

  • #3
    New Coder
    Join Date
    Jan 2006
    Location
    Oslo, Norway
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    This helped me a bit further.

    Then, to set the high byte to 0x00 for ascii values, I simply add 00 to the hex-string i get when using bin2hex($ascii_value)? I'm not completely sure, so I'm thankful for any help.


  •  

    Posting Permissions

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