why can't php write a unicode text file?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • burdeen

    why can't php write a unicode text file?

    I can't find any way of writing a unicode, or UTF-8 format text file.
    Right now i have a Unicode string that i write to the text file and
    the unicode characters are replaced with ANSI question marks '?'.
    Please, How do i accomplish this?

    I've been searching for a solution for weeks... why has nobody even
    asked this question? shouldn't it be a FAQ?
  • Geoff Berrow

    #2
    Re: why can't php write a unicode text file?

    I noticed that Message-ID:
    <1b62743a.04040 70558.27e2e8d5@ posting.google. com> from burdeen contained
    the following:
    [color=blue]
    >I can't find any way of writing a unicode, or UTF-8 format text file.
    >Right now i have a Unicode string that i write to the text file and
    >the unicode characters are replaced with ANSI question marks '?'.
    >Please, How do i accomplish this?
    >
    >I've been searching for a solution for weeks... why has nobody even
    >asked this question? shouldn't it be a FAQ?[/color]

    Did you search the manual? <grin>

    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • Andy Hassall

      #3
      Re: why can't php write a unicode text file?

      On 7 Apr 2004 06:58:53 -0700, paul.burden@kin gproducts.com (burdeen) wrote:
      [color=blue]
      >I can't find any way of writing a unicode, or UTF-8 format text file.
      >Right now i have a Unicode string that i write to the text file and
      >the unicode characters are replaced with ANSI question marks '?'.
      >Please, How do i accomplish this?[/color]

      'Just Do It'. It's unlikely PHP is changing the characters, and not as part of
      writing it to a file anyway, as it barely knows about multibyte encodings
      (other than the mbstring extension). It'll just write it as raw data.

      Post a short runnable example demonstrating your problem.
      [color=blue]
      >I've been searching for a solution for weeks... why has nobody even
      >asked this question? shouldn't it be a FAQ?[/color]

      If nobody asks it, how can it be a Frequently Asked Question?
      Maybe it's a NAQ (Never Asked Question)?

      --
      Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
      http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

      Comment

      • Chung Leong

        #4
        Re: why can't php write a unicode text file?

        "burdeen" <paul.burden@ki ngproducts.com> wrote in message
        news:1b62743a.0 404070558.27e2e 8d5@posting.goo gle.com...[color=blue]
        > I can't find any way of writing a unicode, or UTF-8 format text file.
        > Right now i have a Unicode string that i write to the text file and
        > the unicode characters are replaced with ANSI question marks '?'.
        > Please, How do i accomplish this?
        >
        > I've been searching for a solution for weeks... why has nobody even
        > asked this question? shouldn't it be a FAQ?[/color]

        Open the text file with Internet Explorer and see what happens.


        Comment

        Working...