How to set the system default file character encoding to UTF-8?

Hi all. This is driving me nuts, on both my Windows box and Snow Leopard; I figure much more chance of finding the answer for OS X.
My language and locale are set to Australian English. $LANG=en_AU.UTF-8
However, as I believe is expected, OS X (and Windows for that matter) will create files by default with character encoding of Cp1252 (Latin-1). That is, the FILE encoding in the file metadata - the Byte Order Mark I believe. The file itself, not the characters written to it.
This, in a word, bites. I don't want to be restricted to only ASCII by default, and it is causing me problems with certain software (a Firefox plugin) that creates text files, passing in UTF-8 encoded content, which is then mangled because the file encoding itself is still Cp1252. (I know, I've tested this by changing the file encoding manually and having it overwritten again by the plugin: works correctly.)
As a simple example, just `touch somefile` from terminal creates a file in Cp1252 -- I'm obtaining that info by opening in jEdit by the way (anyone know of something better?).
In other locales that are not English-based, I believe the default file encoding is UTF-8. But surely this can be controlled independently? There must be a system configuration value somewhere that specifies file encoding default. Can someone please tell me what it is?
Thanks!

However, as I believe is expected, OS X (and Windows for that matter) will create files by default with character encoding of Cp1252 (Latin-1). That is, the FILE encoding in the file metadata - the Byte Order Mark I believe. The file itself, not the characters written to it.
Apps like TextEdit and Mail have settings that let you determine the encoding of text produced. The default would normally depend on the character content of the file, ranging from ASCII for basic English to Windows Latin-1 (Win 1252) or ISO Latin -1 (ISO 8859-1) to UTF-8 for other content.
Win 1252 is not ASCII, but has twice the number of characters in the latter.
Byte Order Mark is something totally different --it's a particular character used to signal certain encodings.
http://en.wikipedia.org/wiki/Byteordermark
As a simple example, just `touch somefile` from terminal creates a file in Cp1252 -- I'm obtaining that info by opening in jEdit by the way (anyone know of something better?).
For what Terminal does and how to change it, it might best to post in the Unix forum:
http://discussions.apple.com/forum.jspa?forumID=735
For problems with a FireFox plugin, it might be good to ask on their own forums as well.

Similar Messages

  • How to find the system default scripts and prompts in UCCX 8.0

    Hello everyone,
    I have a bit of experience in UCCX 6.0 and just began to use UCCX 8.0. There's a question that where can I find the system default scripts and prompts in 8.0? In 6.0, I can find them in installing directory, but 8.0 is linux based so I can not do that in same way.
    Thanks.

    You can Login to CLI with either root access or remote user access and get default scripts by going to
    CD /opt/cisco/uccx/Scripts/system/default
    At this point you have to connect to ftp server and move these default script to yoru FTP server.
    I hope this helps

  • How to set the system clock in win2000? in linux? (RH)

    hi There,
    I need to set the system time on a pure java application.
    what is the proper way to do so? (I can't find any system property which corresponds to the system clock).
    if it's platform dependent , then I need to do so on win2000 and on linux RH.
    thanks

    I don't know about Windows but on RedHat, I would use the date command. Check the man pages for date and look at the -s or --set options.  Do a Runtime.exec to execute that.
    Of course, doing the in Java is not the best option. If you are trying to synchronized clocks on Windows and Linux systems, I would use some freely available Network Time Protocol programs. RedHat has a free NTP daemon available as an RPM in the standard distribution. For Windows, theres a free program called "Net Time" that runs as a service. Both can act as clients and servers.

  • How do set the system parameter for user defaults?

    When we are creating new users they are getting the European default for date format and decimal format.  I have found is there is a structure BAPIDEFAUL that contains these values.  However, I have not found the configuration for changing these values.  Does anyone have the answer to this problem?

    Ronald,
    with USERS_GEN, users are created with BBP_USER_CREATECP.
    This function uses DEFAULTS to pass parameters.
    But those parameters are not available in interface or file upload
    USERS_GEN will take default values in system parameters:
    Set date format and decimal format like in system parameters
      data: defaults   type bapidefaul.
      clear defaults.
      CALL 'C_SAPGPARAM'
           ID 'NAME' FIELD 'zcsa/moddatfm'
           ID 'VALUE' FIELD DEFAULTS-DATFM.
      CALL 'C_SAPGPARAM'
           ID 'NAME' FIELD 'zcsa/moddcpfm'
           ID 'VALUE' FIELD DEFAULTS-DCPFM.
    So, this is the only way to "customize" it: define system parameters zcsa/moddatfm & zcsa/moddcpfm in RZ10.
    Rgds
    Christophe

  • How to set the System Setting

    Hi guys
    I have Final Cut Express for a few years but I don’t practice very often, I use it once or twice a year when I have a family project to do. I am confused with the Scratch Drive vs the Final Cut Express Document Folder (Scratch disk>F.C.E. Documents>). About 2 months ago, I start a New project. Before that, I cleared up all the previous project files and from the Preferences I trashed the com.apple FinalCutExpress Plist and from the Final Cut Express User Dater File I trashed the F.C.E. 4.0 Pref and the Ojb Cache and reset my Scratch Disk for capturing (not the startup). Now my editing is almost done. Last week I open the Scratch Drive >Final Cut Express Document Folder, I notice there is no captured files (captured materials,data or media) anywhere in the Capture Scratch, Autosave Vault,Thumbnail Cache File and the Waveform Cache File but there are files in the Audio Render File and the Render File (I suppose this Render File is the Video Render). I open the System Setting, I notice I have set the Scratch Disk for Video Capture, Video Render and Audio Render, the rest are set for Startup Disk; I went to the Startup disk, I found them all filled with something, but I have no idea where to locate my captured materials and I am not sure if these settings are correct or they should all be set to store in the Scratch Disk instead. I am all confused. Right now my questions are where to locate my captured materials (data/medias) and how do I reset the above settings if they need to be reset? I appreciate some one will take time to explain all these to me. My equipment is G4, Final Cut Express 4.0 with OX 10.5. If further info is needed, please adv.
    Thank you ALL.

    If I understand your advice correctly, after the current project is done, I should reset the Thumbnail >Cache File and the Waveform Cache File to the Scratch Disk and leave the Autosave Vault in the >Startup Disk because it is safer.
    Yup. Plus back up your Project file to another media type, CD etc. for double security.
    not to change the clip names either.
    Changing names is fine if you do this within the FCE application because FCE still knows where to find the file. If you change the name in the Scratch Disc through the Finder, FCE will loose the link.
    don’t know how to reconnect them
    Right click an offline clip in the Browser and select reconnect, navigate to where the clip is stored through the window that appears.
    You can search this forum for details and all is explained in the FCE manual.
    Here's one:
    http://discussions.apple.com/thread.jspa?threadID=1968953&tstart=15
    Al

  • How to set the radiogroup default value?

    I have created a radiogroup named P521_SIZE_NUM(Dealsize, DealNum) and want DealSize is checked when the page is showed. how can I set default value in the page Definition?

    If you made a radio group off of the following static LOV:
    STATIC2:One;1,Two;2,Three;3if you set the default value of your radio group to 2, the radio button with the label Two will be selected. You have to make sure to set the default value to the actual return value not the display value.
    -Ghoulies

  • How to set the system date and time in LabVIEW 6i?

    Hi,
    How can I set the time of the computer from Labview 6i? Is there any function to do this?
    Thanks.

    Arnau wrote in message news:<[email protected]>...
    > Hi,
    >
    > How can I set the time of the computer from Labview 6i? Is there any
    > function to do this?
    >
    > Thanks.
    Not natively that I know of. You could use a LabVIEW DLL call to link
    to a Win32 API call which sets the date and time. You would need to
    have privileges to do it.
    Doug D.
    [email protected]

  • How to set the system time in the program

    Hi All,
    How do we update the system time inside java programme.

    AFAIK there is no easy (pure java) way: either you exec something (depending on your paltform) or use native code. Appropriate privileges will be necessary.

  • Setting the System Default Home Page

    Hello everyone... i've created a root page with some portlets on it...
    what i am trying to do is to set this root page as default for a particular user.
    i found some steps online but it doesn't seem to work...
    here is what i was trying to do:
    To set a user's default home page:
    In the Portal User Profile portlet, in the Name field, enter the user name of the user for whom you want to assign a default home page.
    By default, the Portal User Profile portlet is on the Administer tab of the Portal Builder page.
    Click Edit.
    Next to the Default Home Page field, click the Browse Pages icon to see a list of pages from which to choose.
    Click Return Object next to the page you want to make the default home page for this user.
    Click OK.
    please let me know how to do this correctly...
    thank you

    Hi,
        You can change  for example the Branding image, instead of the SAP logo. Refer to this [Thread|MI client homepage log change in MI 7.0;
        Is this what you mean by changing the home page?
    Thanks & Regards
    Veerabhadram

  • How to set the character set to default

    Hi All,
    How to set the character set default to Simplified Chinese(GB2312), current we need change it every time.
    Thanks in advance.

    Hello Michael,
    when we log in SAP in ZH language the character set is getting defaulted to Simplified Chinese(GB2312). But currently the log in Language is in EN and hence the character set to be defaulted to Simplified Chinese(GB2312).
    Also please let me know where is the option for GUI setting?
    Thanks Again in Advance.

  • 1.5 How to globally set the System Cache location

    FROM ANOTHER USER ON ANOTHER BOARD:
    This one did not get answered completely.
    ************************* Question:
    Hello,
    I want to deploy JWS on a client PC with Microsoft XP OS. This client have multiple users. JWS put a file deployment.properties in the directory "documents and setting" for the current user.
    How can I create a uniquely file deployment.properties for all users of this client (new and existing profiles) ?
    Create a directory "documents and setting/all users/application data/sun/java/deployment/" with the file deployment.properties don't work.
    Create a directory "documents and setting/default user/application data/sun/java/deployment/" with the file deployment.properties is working but is not good for the existing users. This is good uniquely for new users.
    is there a solution ?
    King regards,
    funchung
    ************************* ANSWER:
    For windows, the system config file is at:
    {Windows Directory}\Sun\Java\Deployment\
    The value of the {Windows Directory} is determined by using the Win32 API GetWindowsDirectory.
    So for example, on XP, the system config file is:
    c:\WINDOWS\Sun\Java\Deployment\deployment.properties
    The settings in this system config file will be used by all users on the system.
    ***************************** HIS REPLY
    I've tried this and it doesn't seem to work.
    I've also tried createing a deployment.config file as per the http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/properties.html article and this doesn't work for me.
    Has anyone done this successfully??
    ******************************** MY REPLY:
    This is true.
    I can get the system install to work if I add the parameter:
    deployment.system.cachedir=C\:\\testcache
    to the deployment.properties file found under:
    C:\Documents and Settings\username\Application Data\Sun\Java\Deployment
    but it will NOT work by adding it to the:
    C:\WINDOWS\Sun\Java\Deployment
    directory. It just creates a new default one in the user's folder.
    What am I doing wrong?
    If there is not a way to globally set the System Cache location, then this isn't much better than the user cache for being able to "install" the software once on the PC and let any user that signs in access that application.
    We had high hopes for this, since this functionality was taken away from us once the java cache started being stored in the user's folders.
    More details:
    I just tried setting the mandatory=true setting and it tells me that it is not allowed to start because it can't find the
    deployment.properties in the same folder (full path is displayed) but I know it is there, because it is the same folder. I even double checked the spelling.
    Maybe there is a bug in the way it finds that properties file, or maybe I need to include something in that file that I didn't find in documentation?
    All it has in it is the one line:
    deployment.system.cachedir=C\:\\testcache
    Can anybody help shed light on this?
    It seems to be a bug that it can't find the deployment.properties file in the 'system' folder.
    -Chris

    I now found more on another thread:
    http://forum.java.sun.com/thread.jspa?messageID=3500778&#3500778
    You can close this one.
    Sorry.

  • How to set the defualt directory of where to look for a file to read

    I am reading a file from a servlet. I wanted to see where Tomcat would write the file if I didn't specify a path. The results surprised me. It wrote the file in: "C:\Documents and Settings\myusername\Start Menu\Programs\Apache Tomcat 4.1". So I looked through server.xml to see if perhaps this path was set there but didn't find anything. I right clicked on the "Start Tomcat" target to see its properties and there it was. There was a field "Start in:" and it contained the aforementioned path. I changed it to what I wanted but there has to be a way to set this in server.xml. How do I do this. my guess would be something like :
    "<Context path="" docBase="c:/theDefaultDirectory" debug="0"/>", but this didn't work. Any light on this subject would GREATLY be appreciatted,
    silas

    Well, actually, it opens file where the process is currently located on your fileSystem. since you seems to be using windows, the process is started in the directory written in the "Starts In" field. Now you could use the command line (the ugly MSDOS like window), go to some directory and starts the tomcat process from there, and the files would be created in that place.
    The docBase tells where tomcat should look when looking for pages (html jsp, etc...). If you want to use it, you can still refers to it as :
    new File (yourServlet.getServletConfig().getContextPath("/myfile.txt"))Another track to check would be to look in the System.getProperties. There has to be some property that gives the current JVM path, try to change it to the location you'd like it to be and see if it conforms to how you'd like to see it works.
    Still, remember that you can have multiple Context in your servlet container, so there's no reason for tomcat to set the JVM default path to the docBase from one or another (File is a global JVM utility, not a J2EE only feature !!).

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

  • How to set the File Path to run a javascript using Plugin Code?

    Hi All,
    Im new to Indesign Plugin Development.Can any one help me out with my problem.
    What i want to do is to run a javascript using Plugin Code.When i went through this forum i was able to find out that i should use the IscriptRunner Class to automate this.I could also figure out that the Member Function to use is "CanHandleFile" &"RunFile".
    The first parameter in CanHandleFile & RunFile Member Function is to specify the path of the JavaScript File i suppose!I could also find out that IDFile has to used to set the file path Information.
    But im clueless how to set the Javascript FilePath using IDFile.Can any one help me how to do this?Any Code Snippets Please?
    Waiting for reply.
    Thanks
    myRiaz

    Hi,  Andreas<br /><br />  Can you explain this in detail? I found it in your post before.<br /><br />  The content of elements are returned through the Characters callback function:<br /><br />From ISaxContentHandler.h:<br /><br />/**<br />        Receives character data<br /><br />The parser will call this method to report each chunk of<br />        character data. SAX parsers may return all contiguous<br />        character data in a single chunk, or they may split it into<br />        several chunks. But all characters in any single<br />        event must come from the same external entity so the<br />        Locator provides useful information.<br /><br />Note some parsers will report whitespace using the<br />        IgnorableWhitespace() method rather than this one (validating<br />        parsers must do so).<br /><br />@param Chars The characters from the XML document.<br />        */<br />virtual void Characters(const PMString& chars) = 0; <br /><br />  What i have done is implement my own SAXContentHandlerServiceBoss, and in my file XXXSAXContentHandler.cpp, I override the fonctions StartElement, EndElement, and Characters() like below: I add the PMString xmlData to collect the file content:<br /><br />class XXXSAXContentHandler : public CSAXContentHandler<br />{<br />void XXXSAXContentHandler::Characters(const WideString& chars)<br />{<br />xmlData.Append(chars);<br />}<br /><br />void XXXSAXContentHandler::StartElement(const WideString& uri, const WideString& localname, const WideString& qname, ISAXAttributes* attrs)<br />{<br />xmlData.Append("<"); xmlData.Append(localname); xmlData.Append(">");<br />}<br />void XXXSAXContentHandler::EndElement(const WideString& uri, const WideString& localname, const WideString& qname)<br />{<br />xmlData.Append("</"); xmlData.Append(localname); xmlData.Append(">");<br />}<br /><br />}<br /><br />and in my program, I use the code below to call the fonction I overrided, but I dont know how I can get the String xmlData I defined in the XXXSAXContentHandler.cpp<br /><br />InterfacePtr<IK2ServiceRegistry> serviceRegistry(gSession, UseDefaultIID());<br /><br />InterfacePtr<IK2ServiceProvider> xmlProvider(serviceRegistry->QueryServiceProviderByClassID(kXMLParserService, kXMLParserServiceBoss));<br /><br />InterfacePtr<ISAXServices> saxServices(xmlProvider, UseDefaultIID());<br />InterfacePtr<ISAXContentHandler> saxHandler(::CreateObject2<ISAXContentHandler>(kXXXSAXContentHandlerServiceBoss));<br />saxHandler->Register(saxServices);<br />bool16 parseFailed = saxServices->ParseStream(readStream, saxHandler);<br /><br />Can you give me any help?<br /><br />Thanks and regards!

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

Maybe you are looking for