Solved

PHP - save unicoded text file

Posted on 2011-02-19
8
237 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 109

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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 109

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 109

Expert Comment

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

776 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