Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: avoid writing 'use utf8' in every script

by hdb (Monsignor)
on Feb 03, 2014 at 16:33 UTC ( [id://1073228]=note: print w/replies, xml ) Need Help??


in reply to Re^2: avoid writing 'use utf8' in every script
in thread avoid writing 'use utf8' in every script

That is a sentiment I have a lot of sympathy for, but then, would it not be better to stick to ASCII (7 bits)?

  • Comment on Re^3: avoid writing 'use utf8' in every script

Replies are listed 'Best First'.
Re^4: avoid writing 'use utf8' in every script
by reqnode (Novice) on Feb 03, 2014 at 16:40 UTC
    No, my boss requires every source code to be strictly in japanese
      No, my boss requires every source code to be strictly in japanese

      Does your boss also require that all source code files be strictly in a single character encoding scheme of the Unicode coded character set? If she doesn't, she should. In the case of computer programs, the character encoding of the source code file is as important to the computer as the natural language is to the programmer (and to the programmer's boss).

      Think of your problem as two-fold. Firstly, you have a text file character encoding conformance problem. What do you do in your programming environment to ensure that all source code files for all projects are in the same coded character set (e.g., Unicode) and character encoding scheme (e.g., UTF-8)? What discipline do you impose on your programming team to ensure that, for example, no programmer inadvertently creates a source code file in the Shift-JIS character encoding? You should apply some rigor to enforcing that all source code files are in the UTF-8 CES of the Unicode CCS, and that they always include the Unicode byte order mark in them.

      Secondly, you have a Perl multiple source code file inclusion à la do() problem. But when you've solved the first, more fundamental character encoding conformance problem in the way I've suggested, you've also solved this second, more coincidental problem.

      (N.B. The memory footprint of the Unicode byte order mark is quite small.)

      Jim

        What do you do in your programming environment to ensure that all source code files for all projects are in the same coded character set ... ?

        Code editor is set to utf-8 without BOM by default, so it's no problem. OS environment is set to UTF-8 also.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1073228]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-04-25 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found