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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2008
    Posts
    150
    Thanks
    24
    Thanked 0 Times in 0 Posts

    function to convert utf8 to windows 1256

    hello,
    please help me with function to convert utf8 txt to windows 1256

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Try the iconv function. Not sure what its support is though, so you may not be able to use Windows1256.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by crazy.works View Post
    hello,
    please help me with function to convert utf8 txt to windows 1256
    as far as I know iconv work with win 1256 so Fou-Lu solution is ok. In case you have problem you can also use mb_check_encoding and mb_convert_encoding:

    http://www.php.net/manual/en/functio...k-encoding.php
    http://www.php.net/manual/en/functio...t-encoding.php

    regards

  • #4
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    iconv's support is system dependant, and varies depending on the iconv library installed. It tends to be fairly complete, though, and is almost always better than mbstring if it is installed.


  •  

    Posting Permissions

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