datetime problem

N

Nicky

Dr.Ruud said:
Nicky schreef:


You shouldn't care about how a filesystem saves things, you should find
out how to set and how to get the filenames, in the proper encoding, or
just refrain from special characters.

I object to this because i the files i create are not saved in 'UTF8'
(although iam telliogn Notepad2 to do so) hence i need to convert them
many many times inside my scripts.
Wouldn't it be better if the files were saved in 'UTF8' so i wouldnt
have to do this?
Or perhaps you mean somethign else?
Please run this and reply with the output:

perl -MWin32 -e "printf qq{%s\t%08x\t%s\n}, Win32::FsType"

On a W2K-system here, it prints
NTFS 000700ff 255

Yes thats the response i also got (although i dont know what it does)

C:\>perl -MWin32 -e "printf qq{%s\t%08x\t%s\n}, Win32::FsType"
NTFS 000700ff 255
C:\>
 
D

Dr.Ruud

Nicky schreef:
Dr.Ruud:

I object to this because i the files i create are not saved in 'UTF8'
(although iam telliogn Notepad2 to do so) hence i need to convert them
many many times inside my scripts.

The name of the encoding is 'UTF-8', so with the dash.

Are you talking about the filename or about the file contents? The
Notepad 'Save As...' is about the file contents, not about the filename.


#!/usr/bin/perl
use strict ;
use warnings ;

my $euro = "\x{20ac}" ;
my $fn = "EURO-sign.txt" ;

open my $fh, '>:utf8', $fn or die "Error creating $fn: $!" ;
# $^O eq 'MSWin32' and print $fh "\x{FEFF}" ; # BOM (3 bytes)
print $fh "$euro\n" ; # (3+2 bytes)
close $fh or die "Error closing $fn: $!" ;

C:\>perl -MWin32 -e "printf qq{%s\t%08x\t%s\n}, Win32::FsType"
NTFS 000700ff 255

OK, that tells me that your file system is able to store Unicode
filenames, see perldoc Win32.

Windows uses 'UTF-16' for Unicode filenames, see
http://www.perlmonks.org/?node_id=526169
 
N

Nicky

Yes iam talking about the filenames nto the fiel contents. look plz

another guy form perlmonks told me this:

This is my thinking on what you should be checking for - done as a list
to get things straight in my own head more than anything ;-)

The back-end

* In cmd.exe, chcp 65001 to set utf-8 code page (this will probably
only last for as long as you have the same cmd.exe window open).
* Open up the .txt files in an utf-8 capable editor and verify that
the contents look ok.
* Save the files using greek characters in the filename - I know
that MS Word, for one, can do that, so you can always use that if needs
be.
* Check that dir shows you ok-looking greek characters.
* If it does, proceed to the web side of things - if not, you'll
have to figure out what the issue is before even attempting to get it
sorted on your web pages.

The web

* Check that your web pages are saved as utf-8, and that they're
being served up as utf-8 (Firefox will show you this in 'Tools -> Page
info').
* Remove all the from_to code from your form
* Make sure that your browser/font settings are sane (i.e. if
you're specifying a font, that it actually has greek characters in it)
- I'm sure you are though
* ...
* Profit! ;-)

so i did this
Thanks agian Jon for yout help.
I tried to do what you ssaid but when i try in cmd.exe to change the
codepage to UTF8 then the greek file names treing appear liek this whe
i "dir" inside the text dir of mine:

and then all dir contents started to llok very weird.(i cant post
because gogole think this is binary data and wont let me)

What does that tell us?! Somehting is wrong with the encoding isnt it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top