Solved

PHP - save unicoded text file

Posted on 2011-02-19
8
236 Views
Last Modified: 2012-05-11
Hi,

I've written a PHP script which creates and save a txt file with content inside - that works well.
Out of the 4 options that Notepad allows (ANSI, Unicode, Unicode big endian and UTF-8) I've only managed to find how to create the file as ANSI and UTF-8 but I need the Unicode one or any idea how to convert it afterward.

Will appreciate a solution for that.

Thanks
0
Comment
Question by:oferlll
  • 4
  • 2
8 Comments
 
LVL 4

Expert Comment

by:florjan
ID: 34932808
Utf-8 is an unicode charset
0
 
LVL 4

Accepted Solution

by:
florjan earned 250 total points
ID: 34932832
But these links should help
hsivonen.iki.fi/php-utf8/

http://www.phpwact.org/php/i18n/utf-8
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 34933164
Can you tell us WHY you need Unicode?  What characters are not available in the other character sets?

Also, you might benefit from reading this.  It is rather long and detailed, but it offers a good foundation.
http://www.joelonsoftware.com/articles/Unicode.html
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 108

Expert Comment

by:Ray Paseur
ID: 34956760
I'm going to post an objection to closing this question.   Please work with us here.  Did you read Joel Spolsky's article?  Can you tell us WHY you need Unicode?  What characters are not available in the other character sets?

Thanks, ~Ray
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 34956766
Please give us an answer to the questions instead of declaring them "irrelevant."  Thanks.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 34960442
Absent any response from the Asker, I think http:#34932832 and http:#34933164 cover the subject.  But I would hope to see the specific issues so we can see what characters are causing the problem.  

Some additional refs:
http://php.net/manual/en/intro.strings.php#100623
http://php.net/manual/en/language.types.string.php
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now