Gossamer Forum
Home : General : Perl Programming :

Validating for double-byte / single-byte

Quote Reply
Validating for double-byte / single-byte
I am creating a very simple form application with CGI / Perl.

The user enters a few fields of personal information into an HTML form, and the information gets written to a text file.

The tough part is that this is a Japanese application and some of the fields have to be double-byte and some have to be single-byte.

Is there a way to either:

1. Set up the HTML form with the fields defined so as to only allow double or single-byte input, or

2. Check for double or single-byte in Javascript before passing the data onto my Perl program, or

3. Check for double or single-byte in the Perl program.

Thanks in advance.
http://talesoftech.blogspot.com/
Quote Reply
Re: [anroy] Validating for double-byte / single-byte In reply to
As i understand you just want to store Japanese text to file.

Did you try utf-8?
Quote Reply
Re: [thekostya] Validating for double-byte / single-byte In reply to
thekostya wrote:
As i understand you just want to store Japanese text to file.

Did you try utf-8?

Storing to a file is not the problem.

The problem is that I need to validate that some form fields are entered as double-byte and some as single-byte.
http://talesoftech.blogspot.com/