Do you have a question? Post it now! No Registration Necessary. Now with pictures!
January 25, 2005, 8:18 pm
rate this thread
Re: utf-8 and ascii
> I have a question.
Perhaps then you should ask it.
> how to generate two files, one in UTF-8, the other
> in ASCII
Simply copy the ASCII one. The UTF-8 encoding was designed so that if a
document only uses Unicode code points that are also in ASCII (i.e.
<128) then the ASCII and UTF8 encodings would be binary identical.
> with the same column length.
What is "column length"?
> So that when you input the data
> encoded in utf-8, into a table the clolumn length does not change.
What is "a table"?
> Any help is appreciated..
I suggest that before hitting send on a question you read it and try to
pretend you didn't already know your situation. If, as in this case, it
would be impossible to figure out what you are trying to ask then don't
hit send, instead revise your posting. Repeat as necessary.
Random-shot in the dark...
You are trying to do in-place edits on UTF8 text files that use
fixed-character-width fields. You cannot. To do true in-place edit
the file format must be fixed-byte-width. This, of course, has nothing
to do with Perl.
To have a file that contains fixed-byte-width records and uses UTF8
encoding it's probably best to open the file as a binary file and
explicitly convert using the utf8::encode() and utf8::decode(). (Note:
despite the namespace prefix these are in fact builtins).
For details of how to generally change bits in the middle of files that
don't contain fixed-byte-width records see FAQ.
- » ANNOUNCE: Games::Go::AGATourn and Games::Go::GoPair modules released
- — Next thread in » PERL Modules Announcements