How to check the encoding of the String?

hi everybody
Could anyone tell how to tell from a String object in which encoding it is written? Is it UTF-8, UTF-16 etc. Is there any class that posses such a method. Another problem is that this solution must work under java 1.3.
Thx in advance.

Ok, but for example when you read from the file it
can be encoded in the UTF-8 or ANSI coding. Yes, so you have to tell Java which encoding to use, or it will use your default encoding. Some of the I/O classes have constructors or methods that let you specify which encoding to use.
Moreover
when read from the request in a servlet it is usually
encoded in the UTF-8 coding.If that's specified in the HTTP headers, then the core API classes that grab it before handing it to you will do the conversion I think.
My question is how to
determine the encoding. Maybe i wasn't clear enough
in my previous post, sorry for that.In general, you can't just look at a file and know the encoding. You have to know, or have an external means to find out.

Similar Messages

  • How can I temporary change the encoding of the current page as I can do on IE ?

    In IE, I can choose the encoding of the current page from the menu bar. How can I do this on Firefox ?
    Just the current page only. Not the preferred language in option menu please.

    Hi Aaron,
    If you want to see the most recent n samples in your chart while n can be modified during runtime, than I might have a solution for you...
    Please check out the modified VI.
    Regards,
    Thomas
    Attachments:
    Waveformdatapoints_mod.vi ‏13 KB

  • How to check Debug messages in the server

    Hi All,
    I am working on extensions and in my java controller file i have certain System.out.println messages. I would like to know how to check these messages from the server for debugging purpose.
    Kindly help me in the same.
    Thanks
    Deeksha

    11i - log file location - $APACHE_TOP/Jserv/logs/jserv.log
    r12 - log file location - $INST_TOP/logs/ora/10.1.3/opmn/oacore_default_group_1/oacorestd.out
    You can prepend your SOP with some text and search for the text in the log files.

  • How to limited Media Encoder connect the media server?

    how to limited Media Encoder connect the media server?
    I have a adobe media server3 for liniux and  hava a live IP.
       I can  use the Media Encoder connenct the media server anywhere  when I use the live IP.
    I want to know how to limited Media Encoder connect the media server.
    thank you!

    You can use an authorization plugin, or you can use server side actionscript to validate credentials (as of FMS 3.0, you can use get variables in the RTMP URL)

  • How to check who has approved the PO or PR?

    Hi,
    Can someone tell, how to check who has approved the PO or PR?
    Regards.

    Go to PO display ME23N go to enviornment data and see for header changes here you can see the person who has release the PO at what dat with time, user id and T-code used for release.
    Else if version management is activated in your client then check at the version tab at the header level of PO here also you will find the required details.
    For PR you can check the item details.
    Regards
    Sujoy
    Edited by: Sujoy on Apr 9, 2009 1:18 PM

  • How to check data type of the field symbol at run time

    Hi,
    My code is as following:
          LOOP AT <fs> ASSIGNING <wa_covp_ext>.
            ASSIGN COMPONENT 86 OF STRUCTURE <wa_covp_ext> TO <f_zzname>.
            IF sy-subrc = 0.
              ASSIGN COMPONENT 158 OF STRUCTURE <wa_covp_ext> TO <f_pernr>.
              IF sy-subrc = 0.
                  SELECT SINGLE sname INTO <f_zzname> FROM pa0001
                                WHERE pernr = <f_pernr>
                                AND endda GE sy-datum
                                AND begda LE sy-datum.
             ENDIF.
          ENDIF.
        ENDLOOP.
    This query is giving dump when <f_zzname> is type P length 8 and decimals 2, because it tries to put PA0001-sname into it which is type C length 30. So I want to check the type of <f_zzname> before the select statement. If it is character 30, then I will write the select statement else not.
    How to check data type of the field symbol at run time? If it's not possible, then can somebody suggest a workaround? Thanks.

    check this ...
    write describe statement  ...
    field-symbols : <f_zzname> .
    data : sname like pa0001-sname,
           typ(10).
    assign sname to  <f_zzname>.
    describe  field <f_zzname> type typ.
    write : typ. <-- typ contains character type in this case ..
    U can check if typ is of character(C) if so .. write the select statement ...

  • Is a way to find out the encoding of a String?

    Doesn anyone know how to find out the encoding?

    There are some circumstances in which a file (or more
    generally, a stream) may expose its own encoding,
    IIRC. But of course that's the exception, not the rule.As part of a higher level protocol, sure. HTTP, for example, may have it in a couple places (headers or in the HTML head section). Plain text files do not, however.
    But anyway at this point I'm not convinced that
    anyone knows for sure what the OP wanted or needed.I agree with that. Not convinced the OP knows, either.
    Was he really looking for a heuristic to correctly
    y guess the encoding of a stream of bytes, so that
    encoding could be used as input to a String
    constructor? Or did he just not know how to use the
    API?To the OP:
    If you have a String, there's no encoding, it's all Unicode chars in the string.
    If you have a bunch of bytes (byte[], file, input stream, whatever), then there is some encoding. If you don't know what the encoding is, there's no 100% sure way to figure it out. Some code exists, as mentioned, that can make educated guesses, particularly if you know it's one of a few possible choices. Beyond that, bytes are bytes are bytes, and how they are interpreted by character based classes/methods (like new String(byte[], String)) is defined by the encoding you tell it to use.
    So aside from that, what's the issue you're trying to solve?

  • How to Check a file in the directory..

    Dear,
    Pl. do suggest me how to check a file (e.g. abc.txt) is in the directory (say d:\Print).
    Do tell me how to check whether this file is exist in the directory or not???
    Thanx in Advance.
    Bhavesh

    Hi
    You can use Win_Api_Utility.Copy_File cmd. IF the file does not exist r the file was not copied to the destination properly, it will raise no_data_found error. See Forms help - Find option for syntax & more details.
    I've used it & works well.
    Regards
    APK

  • How to check who has edited the meeting invites on calendar

    Hi,
    we are in exchange server 2010 environment. How do we check who has edited the meeting invites on calendar? 
    I tried with get-calendardiganosticlog. But no help..
    Sankar M http://messagingdevelopment.blogspot.in/

    First of all, I would like to confirm if you have
    assigned any privilege
    to someone as an Editor. If so, he/she would be able to change, edit or delete meeting requests. You may enable auditing for such changes that will help you to check the changes such as,
    who was the person of changes. Please refer to this well described article that helps to understand this concern step-wise :
    http://msexchangeguru.com/2011/07/14/outlook-meeting-vanishing/
    Moreover, here is another good auditing resource (http://www.exchangeauditing.com/) that could be an appropriate solution to track such changes made in exchange server at granular level and get the captured
    auditing data into real time.

  • HT4859 how to check my backup in the computer

    How can i check my data in the cloud

    Unfortunately you cannot check the files etc. in your backup.

  • How to check which user has the privilege to execute a stored procedure?

    I am using Oracle 7 and I would like to check which user has the privilege to execute a stored procedure. How can I check it? Is there any view I can query for?
    Alex Hung

    Please check DBA_SYS_PRIVS.
    SQL> select * from dba_sys_privs
    2 where grantee='HARY';
    GRANTEE PRIVILEGE ADM
    HARY EXECUTE ANY PROCEDURE NO
    ....

  • How to check Role based on the User ID

    Hi All,
      Based on the User ID how to check the role of the particular person[ex Employee / Manager etc].In HR module in which table the details are present.
    Thanks.
    Regards
    Tina

    Hi Tina,
    Use FM: <b>HR_GETEMPLOYEEDATA_FROMUSER</b>
    This will give you all info related to User ID.
    In parameter EMPLOYEESUBGROUP , you will get position of this employee.
    Hope this helps.
    Regds,
    Akshay Bhawgat
    Note: Some points would be nice if it helps.
    Message was edited by: Akshay Bhagwat

  • How to check two IPs in the same subnetwork?

    It seems java.net package doesn't provide this mothod.
    thx.

    I'm not sure I understand what your asking for. You want to determine if to ip addresses are in the same subnet?
    If so, you need to know the netmask-configuration for the two addresses. Then compare the bits in the two ip-addresses in all positions where the netmask has bit its bit set.
    In many cases netmask is set to 255.255.255.0, so you can compare the leading three parts of the two ip addresses. However, this simple check will give false results when the netmask is not 255.255.255.0.

  • How to check if you have the latest version of iTunes

    I have found the following article:
    http://support.apple.com/kb/ht5654
    however, it says to click "help" on iTunes.
    I suppose it would assist me if there was actually a HELP button to click!
    Most of the articles on the support centre are out dated. This is the second issue with iTunes that i've had to resolve tonight, where the article has told me to click a button that doesn't exist!
    Does anyone know how I can find out what version I have?

    Cntrl + b will dispaly the menus.

  • How to check folder sizes of the root directory on my VPS/Dedicated server via Terminal?

    Hi,
    I have following issue.
    I have a VPS with Linux OS and I'd like to check size of the folders as well as remaining space on my server.
    How can I do that via Terminal?
    I would appreciate any input.

    login into your VPS server via terminal and cd into the root of your hosted space.  Then use the df -h command to see the listing
    for i.e.
    df -h /volumes/volume_1
    Filesystem             Size   Used  Avail Capacity iused      ifree %iused  Mounted on
    //john@ds00/volume_1  457Gi   12Gi  445Gi     3%       0 18446744073709551615    0%   /Volumes/volume_1
    for you it would be something like:
    df -h [email protected]/share (ip address)

Maybe you are looking for