There is a question about encode String

hello
i find a question when i decode java program at linux(redhat 7.3 Valhalla) and J2SDK 1.4.1_02.
when i want to encode a String from GB2312 to UTF-16BE, the String used CJK and alpha bet mixed. the String length is error and can not convert success!
from API documents, the string length when count the CJK character ,2 bytes count to 1,but there is 2! for example ,when i encode a CJK character to a UTF-16BE,when the string length is 1.then in the UTF-16BE should be 1,but there is not 1 but 2!!!:(
by the way ,when my code run at windows2000,it's right!! no error!
to everyone:what should i do ? is it a bug in j2sdk1.4.1_02?

There are multiple 16-bit Unicode encodings, i.e.,
UTF-16
UnicodeBigUnmarked
UnicodeLittleUnmarked
UnicodeBig
UnicodeLittle
with/without BOM (byte order mark).
Try these at a time, or confirm the unicode encoding used on an OS by the following.
System.out.println(System.getProperty("sun.io.unicode.encoding"));

Similar Messages

  • Technical question about encoding:  Experimentation may be needed, but..

    I work with a team producing a weekly video for distribution to two other sites. Up until now, we have been capturing (Canon XL2 into FCP on iMac via FW), doing a few quick edits and sending to a DVD via compressor. As an aside, we also have compressor put out a smallish web-version for upload to our website.
    We distribute the video DVD for use with a live audience, whose sole engagement with content from us is via video (We are a church). It's working, and has been working for about a year. Minus a few mishaps - mostly human error stuff...
    I would consider recommending a move to distributing video as files instead of physical DVDs. The potential advantages I see are:
    1. We can encode at a higher quality than DVD
    2. No time spent burning the DVD
    3. No physical transport of a physical device (made of cheap plastic) - We could upload/download via Dropbox or some similar model.
    4. The technician starting up the playback wouldn't have to fight with the DVD-player going to "sleep".
    My question for this forum is on the technical side of things. Can we use FCP/COmpressor to actually put out a higher quality video if it's a file to play on a Mac? If so, how? What kinds of encodes should we experiment with?
    Thanks all!

    Can we use FCP/COmpressor to actually put out a higher quality video if it's a file to play on a Mac?
    yes
    If so, how?
    Simply use Compressor to encode whatever comes out of FCP. There are lots of presets for h.264 based file generation from highly compressed to nearly visually lossless.
    What kinds of encodes should we experiment with?
    See previous answer.
    The key element is all the computers must be able to play h.264 quicktime files. Current Macs will have no issues. And, as long the PC people download and install a current version of Quicktime Player, it is a cross platform compatible format.
    x

  • Question about the String class

    Did I understood the JLS/Javadoc properly if I say that the String class has got an internal pool of String objects (therefore I expect this pool to be stored in some sort of static variable)?
    Looking at the intern() method in the String class, this is declared as native, which make me think the whole pooling thing is managed internally by the JVM.
    Does this mean that, if there is only a String class per JVM and String literals (or better Strings that are values of constant expressions) are pooled in the String class, the more String constants are around the bigger the String class object becomes?

    Did I understood the JLS/Javadoc properly if I say
    that the String class has got an internal pool of
    String objects (therefore I expect this pool to be
    stored in some sort of static variable)?Yes.
    Looking at the intern() method in the String class,
    this is declared as native, which make me think the
    whole pooling thing is managed internally by the JVM.The intern() method is implemented in some programming language. If you happen to have a Java runtime where it is written as a native method, it is probably implemented in C or C++. Not a terribly important detail.
    Does this mean that, if there is only a String class
    per JVM and String literals (or better Strings that
    are values of constant expressions) are pooled in the
    String class, the more String constants are around
    the bigger the String class object becomes?The String.class object (of type java.lang.Class) as such doesn't "grow", but some memory structure somewhere will contain interned String literals. Probably a hash table of some sort. Yes indeed: if you have String literals in your program, those literals are stored in the computer's memory during runtime so that they can be accessed by the executable program code.

  • Question about encoding/decoding a custom UIComponent

    Hello,
    I am trying to create a custom JSF component using the following code :
    class UICustomCTP extends UIInput {
          * Component that holds a list of Norms
         public static final String COMPONENT_TYPE = "org.alfresco.faces.CustomCTPInput";
         public static final String COMPONENT_FAMILY = "javax.faces.UIInput";
         // ID's
         private static final String ID_CTPKEY_FLD = "-ctpkey-field";
         private static final String ID_CTPDESC_LST = "-ctpdesc-list";
         @Override
         public String getFamily() {
              return COMPONENT_FAMILY;
         @Override
         public void encodeBegin(FacesContext context) throws IOException {
              // Set-up the dynamic id's
              String idClient = getClientId(context);
              String idCtpKey = idClient + ID_CTPKEY_FLD;
              String idCtpDescList = idClient + ID_CTPDESC_LST;
              ResponseWriter writer = context.getResponseWriter();
              writer.startElement("div", this);
              writer.writeAttribute("id", "ctp-container-part", null);
              writer.writeAttribute("class", "ctp-container-part-style", null);
              writer.write("R�sum� :");
              writer.startElement("input", this);
              writer.writeAttribute("id", idCtpKey, idCtpKey); // is the property name should be the same as the key?
              writer.writeAttribute("type", "text", null);
              writer.writeAttribute("value", "", null);
              writer.writeAttribute("style", "width:20px", null);
              writer.endElement("input");
              writer.startElement("select", this);
              writer.writeAttribute("id", idCtpDescList, idCtpDescList); // is the property name should be the same as the key?
              writer.writeAttribute("size", "5", null);
              writer.writeAttribute("style", "width:300px", null);
              writer.writeAttribute("multiple", "1", null);     
                   there's many option items here
              writer.endElement("select");
              writer.endElement("div");
              super.encodeBegin(context);
         @Override
         public void decode(FacesContext context) {
              super.decode(context);
              // Set-up the dynamic id's
              String idClient = getClientId(context);
              String idCtpKey = idClient + ID_CTPKEY_FLD;
              String idCtpDescList = idClient + ID_CTPDESC_LST;
              // retrieve the request
              Map requestParamMap = context.getExternalContext().getRequestParameterMap();
              String ctpKeyInputValue = (String) requestParamMap.get(idCtpKey);
              List<String> ctpDescInputValueList = (List<String>) requestParamMap.get(idCtpDescList);
              Object ctp = new CTPItem(ctpKeyInputValue, ctpDescInputValueList);
              setSubmittedValue(ctp);
              setValid(true);
         @Override
         protected Object getConvertedValue(FacesContext context, Object submittedValue) {
              CTPItem ctpItem = (CTPItem)submittedValue;
              return ctpItem;
         } I don't have, and don't need and I cannot use renderer, tag definition, taglib definition because this component is generated through Alfresco ECM
    (and I don't have access to the JSP (not authorised)).
    My problem:
    When I try to read the inputs through request parameters :
          String ctpKeyInputValue = (String) requestParamMap.get(idCtpKey);
          List<String> ctpDescInputValueList = (List<String>) requestParamMap.get(idCtpDescList);It returns always null.
    It's is not very clear what value to put in the third parameters in writeAttribute and what is the logic behind with that property.
    It looks like I forget to implements something but cannot find what. I read many tutorials and forums but didn t find any solution.
    Thanks if somebody can help me.

    Silly me... just forget that id and name are not the same...
    Thanks, it work perfectly with name attributes.
    Regards,
    Patrick

  • New user, question about encoding...probably been covered a few times

    I am new to MAC's and video. Let me get this straight and make sure I am doing this right. I made a 1hr 18 minutes video in IMOVIES. I exported it (Share Movies - Medium Size for DVD viewing). It takes like 2 1/2 hours to encode. Is this right? Then, I opened up Magic DVD in IDVD and pulled the Video that I made on IMOVIES and added one of their snazzy intros. From this point, I am a little confused. Do i go to Project - project info - and change to high quality? or keep at Best Performance? Even though my video is 79 min (4.36 GB) it says I have reached my maximum amount and need to change encoding or something to burn? where do I go for that?
    Lastly, right now I am on project info, set to best performance and it is encoding. How long does a 79 min video take to encode? Is it going to let me burn it after it finishes? Sorry new here but a quick learner.

    I am not sure with imovie since I use only Final Cut Pro. iDVD setting will let you expand the file for length. Naturaly the best quality pr performance will take less time of a file. In the case with iDVD 4 the best quality will only take 60 minutes of video already compressed. Best performance will take up to about 1 hour nd 49 minutes. You have to leave enough room for the menu to take up some space on the disc as well. In FCP we have to export as a quicktime file where with a 1 hour 30 min video can take about 20 minutes to export. the burning and compression time depends on the system you have. G5 faster, G4 like mine takes longer. on that same video idvd 4 will take about 3 hours to convert and burn the disc. When I use DVD Pro Studio that is way different and take a lot longer. I have had a typical 2 hour video take up to 14 hours to convert/export to a MPEG 2 format or DVD format. But the burning process take about an hour. It all depends on your equipment.
    Hope that helps.

  • Labview novice with a question about scanning strings

    Hello, I'm a research assistant tasked with taking data received via TCP-IP and plotting it. I've had a couple of problems, probably because I've never used Labview before.
    The data is sent in sets of six values separated using semicolons as delimiters, for example
    "0.086842;0.00020341;0.00039838;-0.14057;-0.12614;​-0.1327;" is one such data set
    Receiving these strings through TCP connection is working just fine, however I just noticed that after passing a string such as my example into a 'Scan String for Tokens' block, the negative signs are dropped from the latter three values. I assumed it has something with setting '-' as an operator, but simply wiring negative sign in as an operator didn't change anything. I know there has to be a way to retain my negative signs, but I can't figure it.

    Is this what you need?
    Attachments:
    SNAG-002.jpg ‏91 KB
    SNAG-003.jpg ‏20 KB

  • Question about splitting string for placeholder in SE91

    Hi all,
    In SE91, I had a message with placeholder & & & &.
    In my program, I will have my message passed into a variable.
    I will then split the message into 4 equal portion to be fit to the placeholder.
    The problem is, the placeholder will display additional space in between a word if that word is splitted. I can't type a very long example, but I will try to explain using the example below,
    My message, V_TEXT is : Hello. Today is Wednesday.
    Let's say I split it to
    V_TEXT1 = Hello. Toda
    V_TEXT2 = y is Wednesday
    V_TEXT3 = blank
    V_TEXT4 = blank
    WHen I display in the system message, the message will become
    "Hello Toda y is Wednesday", with a space between Toda & y. How can I solve this? Thanks in advance.

    Hi Mil,
    Please use &1&2&3&4 in your message instead of & & & &.This will avoid the unnessary space in between.
    Regards,
    Shobha

  • Quick question about Quicktime media keys.......

    I had a question about encoding video and media keys. It seems to me that the only codec that allows you to encode it with a media key is Sorenson (Sorenson 3 I think). Why are they the only ones that are enabling that in their codecs? Is it kind of a dying technology or practice? I've experimented with Sorenson 3 and Sorenson Squeeze trials and, even though it looks ok, it simply doesn't stack up to others like Apple's H.264 or open-source x264 or even Xvid. I guess I wish there were a way to be able to use media key options with all the new H.264 codecs. Is it possible to do that, either with Xcode or AppleScript? Any help would be greatly appreciated!!

    QuickTime has supported 'media keys" since version 3 but you can only add them using the third party software.
    You would be better served by contacting Sorenson and asking them about their support for newer codecs.

  • Some question about the renegotiation function in SRM Contract (GOA)

    Hi All Expert,
    We are on SRM 5/4.6,  there is a question about the renegotiation function in SRM GOA.
    Can we renegotiate the price for some parts in the GOA items with this function ( e.g. Only renegotiate one item in the contract) ?
    Will the item price updated automatically after the renegotiation?
    Many thanks in advance!!!
        Wendrin

    Hi Sanjeev,
    Many thanks for your help.
    One more question, if I add a new item when we renegotiation, will it be transfered to contract and create a new item after that?
    Thanks and best regards
    Wendrin

  • Audigy 2 ZS: questions about TAD connect

    <SPAN>The drivers for my motherboard?s onboard sound were causing problems, so I replaced the onboard sound with an Audigy 2 ZS card.<SPAN> It is fantastic!<SPAN> I am not having any problems, but there are some questions about its use the answers to which I have not been able to glean from the manual or the online knowledge base.<SPAN> Since my questions involve three different issues, I am making three different posts.<SPAN> I hope this doesn?t violate some kind of posting rule.<SPAN> If it does, I apologize.<SPAN> I certainly will appreciate any help anyone can give me.
    <SPAN><FONT color=#000000 size=3>I have a USR 2976 voice modem in a PCI slot next to my new Audigy 2 ZS card.<SPAN> The 2976 modem is very common; but since it is OEM, US Robotics? support consists essentially of acknowledging its existence.<SPAN> I would like to make a TAD connection between the sound card and modem in order to use the sound card in a speakerphone setup.<SPAN> The modem has only one side connector and it looks identical to the TAD connector on my Audigy 2ZS, but I don?t know its pinouts.<SPAN> (I found the Audigy card?s TAD pinouts online.) Since my optical dri'ves use digital audio extraction, I don?t need the CD audio cable that went from one optical dri've to the motherboard?s CD sound in connector; and I disconnected it.<SPAN> The CD audio cable fits only one way into both the sound card TAD connector and the modem?s similar 4-pin connector.<SPAN> Would I be safe in connecting the modem and sound card together using the CD audio cable even though I don?t know the modem?s pinouts for its connector?<SPAN> Are most modems consistent in this?
    <SPAN><FONT color=#000000 size=3>The CD cable is fairly long.<SPAN> I would need only a very sort cable to connect the two adjacent cards, but I have not been able to find a short one.<SPAN> Does anyone know a source or if there is a specific name for a short cable for this purpose?<SPAN> (I have had no luck googling ?TAD cable?.)

    BigBen,
    I'll answer your questions here point by point (for clarity).
    ) No, that won't be possible. A line input is only stereo, so all you'll receive signal-wise is just a stereo stream. You'll need a coaxial or optical input to get that signal to the card (only available on the Platinum dri'ves).
    2) In theory that could work, yes, the connections are there. That isn't something we would have tested (or support), though.
    Cat

  • Question about histogram types

    Hi there,
    I have question about HISTOGRAM column in ALL_TAB_COLUMNS.
    There are 3 different histogram modes in all_tab-columns.:
    NONE, FREQUENCY , and HEIGHT BALANCED .
    Has anyone knows about these options in detail and how can I change between
    these?
    Thanks.

    And Wolfgang Breitling's papers are always the best resources about histogram.
    http://www.centrexcc.com/papers.html

  • Question about free down loading Mavericks. On checking Mavericks before downloading that there are no Bangla language in the list. I occasionally use Bangla in my present Mountain Lion. My concerns if I down load Mavericks then what will happen to Bangla

    Question about free downloading Mavericks. On checking Mavericks before downloading that there are no Bangla language in the list. I occasionally use Bangla in my present Mountain Lion. My concerns is, if I download Mavericks then what will happen to Bangla language in mountain lion? Samar Laha

    No reason to be embarassed. You are not alone.
    You will need an external drive. If you have a Time Machine drive without enough disk space you can create the clone there however it's advised that you keep your Time Machine and clone on separate drives. If the drive dies you loose both types of backup.
    Download and install the clone software. Everyone has their favorite. These are the two most common applications used. I prefer SuperDuper because of it's simplicity in setting up. It's also free for the first clone where with CCC you have to give a Credit Card then cancel if you do not want to keep.
    SuperDuper! http://www.shirt-pocket.com/
    CCC http://www.bombich.com/download.html
    Select your drive in the To popup. Click on Copy Now. That's it.
    Yes, it really is that simple....

  • I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM... I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM? Is there any way to get more VRAM to play games on steam?

    I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM...
    I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM?
    Is there any way to get more VRAM to play games on steam?
    I've learned  by reading other topics that I can't upgrade my graphics card on my Macbook Pro because it's soldered into the motherboard or somthing like that, but please tell me if there is any way to get more video ram by chaning some setting or upgrading something else. I'd also like to know why I only have 256MB of VRAM when I have 8GB of RAM, since I have 8GB of RAM I thought I was supposed to have 560mb of VRAM...
    So the two questions are...
    Is there any way to upgrade my VRAM, so that I can play games on steam?
    Why do I only have 256MB VRAM when I have 8GB total RAM?
    Other Info:
    I have a quad core i7 Processor.
    My graphcics card is the AMD Radeon HD 6490M.
    I am also trying to play games on my BOOTCAMPed side of my mac, or my Windows 7 Professional side.
    THANK YOU SO MUCH IF YOU CAN REPLY,
    Dylan

    The only two items that a user can change on a MBP are the RAM and HDD (Retinas not included).  You have what the unit came with and the only way you will be able to change that is to purchase a MBP with superior graphics
    If you are very much into gaming, the I suggest A PC.  They are far superior for that type of application to a MBP.
    Ciao.

  • I have a question about using multiple ipads in our school.  Each of our teachers have a iPad and AppleTV in their classroom.  The issue is, with our classrooms so close in proximity to one another, is there a way to pair teacher

    I have a question about using multiple ipads in our school.  Each of our teachers have a iPad and AppleTV in their classroom.  The issue is, with our classrooms so close in proximity to one another, is there a way to pair teacher #1 iPad to its AppleTV without effecting/projecting onto the adjacent teachers #2 classroom AppleTV?

    Not as such.
    Give the AppleTV units unique names and also enable Airplay password in settings with unique passwords for each teacher.
    AC

  • I have an urgent question about my indesign. I had problems with the creative cloude app and then uninstalled it and then installed it again. Now it is not opening and I cannot download it again either. Pls give me help and advice if there is anything I c

    I have an urgent question about my indesign. I had problems with the creative cloude app and then uninstalled it and then installed it again. Now it is not opening and I cannot download it again either. Pls give me help and advice if there is anything I can do to repair it

    Please authorize ADE 3 with same credentials that you used with older version of ADE

Maybe you are looking for

  • Resolution problems exporting to DVD

    I am brand new to FCP 5 and everything I have learned has been within the past two weeks. I have read MANY posts on resolution settings, square pixels vs. retangular pixels, iDVD problems, exporting problems, etc. However I have not found an answer t

  • Question on endSeparator in JMS sender Adapter

    Hi, My scenario is -  JMS(Sender) to IDOC(Receiver). So I am picking data from MQ and populating IDOC via XI. My source structure is below. RecordSet( 1 : Unbounded) Header (Occurs only one time) Delivery (1 : Unbounded) RecordSet can occur multiple

  • How to change two tied eighth notes to a fourth in score?

    Hi all! I can't for the life of me figure out how to change a fourth note that score has interpreted as two tied eighths. The pair occurs on the last beat in a 11/8-bar. I've tried defeating interpretation but the tied notes are still there. There mu

  • How do we rotate photos now in iOS 8?

    Under iOS 7, it was pretty easy to rotate a photo if the camera misunderstood its orientation when the photo was taken. There was an arrow tool that rotated the image 90 degrees at a press when you tapped "Edit" on the image. This seems to be gone un

  • Homogeneus system copy error

    Hi all, I have already functionally a SAP instance PRD ECC 6.0(ABAP only) on server with Windows Server 2008 R2 X64 and Database MSSQL 2005. I tried to make a Homogeneus System Copy with Backup/restore method on same server but i have some errors. I