Solved

PHP - save unicoded text file

Posted on 2011-02-19
8
235 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

744 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

11 Experts available now in Live!

Get 1:1 Help Now