16-bit Character Output

I'm trying to read and write 16-bit characters to a file. If i write a character such as (char)8226 I am able to read it back in from the file without any issue. However, if I write out and try to read (char)8227 it will be read in as (char)63. I noticed that 63 is a ? and 8227 is displayed as a ? when printed (and how it appears in the output file). It seems like any character that displays as ? will be read back in as a real ? with code 63. The reason for this question is because i am manipulating the characters on the bit level and the result is often one of these "invalid" characters.
So I guess I have two questions.
1) Why cant I write and then read these "invalid" characters properly. They seem to be just like the "normal" 16-bit characters so what makes them different?
2) Is there some way that I'm missing to write and read them properly or is there some kind of work around for this problem?
I would greatly appreciate any help on this topic.
Thank you.

Yes, by 16-bit character I do mean Unicode. My point is that the typical characters used like the alphabet and numbers are in the range of 0-127 but the characters im working with now are much higher than that.
It would make sense that encoding would be causing my problem but i dont know how to change the encoding since ive never needed to do it before. The only flaw in that conclusion is that it will read 8226, a 16 bit character, correctly.
Part of my problem here is that im not sure whether the error is in output or input (or both).
This is a little test i just ran. It creates a short string which includes two large characters, 8226 which gives me no trouble and 8227 which does cause a problem. You can see from the output that 8227 is the only character that is not read in correctly.
public static void main( String[] args )
{     try
     {     String str = "abc" + (char)8226 + "def" + (char)8227 + "ghi";
          PrintWriter pw = new PrintWriter( "out.txt" );
          pw.write( str );
          pw.close();
          FileReader in = new FileReader( "out.txt" );
          char[] cbuf = new char[100];
          int read = in.read( cbuf );
          String inStr = new String( cbuf, 0, read );
          System.out.println( "Output\tInput" );
          for ( int j = 0 ; j < str.length() ; j++ )
          {     char c1 = str.charAt( j );
               char c2 = inStr.charAt( j );
               System.out.println( c1 + " " + (int)c1 + "\t" + c2 + " " + (int)c2 );
     catch ( Exception ex )
     {     ex.printStackTrace();
}Output is as follows:
Output     Input
a 97     a 97
b 98     b 98
c 99     c 99
� 8226     � 8226
d 100     d 100
e 101     e 101
f 102     f 102
? 8227     ? 63
g 103     g 103
h 104     h 104
i 105     i 105

Similar Messages

  • ECC6.0 - PDF issue - Junk Character output after Upgrade from 4.7c

    Hi All,
    I am working in Uprgade project(from 4.7c Non-unicode system to ECC6.0 unicode system).
    We are facing PDF output issue in ECC6.0 that means we are getting junk character output(screenshot is attached for your reference).
    In 4.7c , we have stroed the OTF data in table after generated from smartform as we should not get different output in future. Whenever we need output of the same then we are getting the OTF data from that table and we will generate pdf through "Convert_otf" function module.This logic is working fine in 4.7c.
    In ECC6.0 ,the same logic is not working as system is unicode sytem and we are getting junk character output.
    As per my old upgrade project experience , i have used the below piece of code for solve this junk character issue but still I am facing the same issue.
    Kindly note that in my old upgrade project i have regenerated the OTF data in ECC6.0 and used the below piece of code then I got correct output but here I have to use the old OTF data (from table) which was generated in 4.7c.
    Please any one can give solution for this issue.
    Regards
    Anandakumar.K
    +91 9486963561.
    REPORT  z_display_notification_tst.
    Local Vairable Declaration
    TYPES: lt_pdf_table(1000) TYPE x.
    Local Vairable Declaration
    DATA :
      lv_otf_data         TYPE STRING,            " OTD data in string format
      lv_length           TYPE i,                                   " OTF Length
      lv_lines            TYPE i,                                   " No of lines
      lv_no_of_recs       TYPE int4,                                " No of OTF Lines
      lv_offset           TYPE int4,                                " Offset
      pdf_fsize           TYPE  i,
      lv_binfile          TYPE xstring,
      gv_reportsize       TYPE i,
      l_url(80) TYPE c,
      l_pdf_data TYPE STANDARD TABLE OF lt_pdf_table ,
      l_pdf_line TYPE lt_pdf_table,
      l_offset TYPE i,
      l_len TYPE i,
      lt_pdf_table        TYPE rcl_bag_tline,
      lt_otfdata          TYPE tsfotf,
      ls_otfdata          TYPE itcoo.                               " Line type of OTF data
    DATA:
        g_html_container TYPE REF TO cl_gui_custom_container,
        g_html_control   TYPE REF TO cl_gui_html_viewer.
    ******************GET OTF data from Table ******************************
    Primary Keys used for selection : BUSKEY,
                                      NTFTYP,
                                      TRNTYP,
    SELECT SINGLE otf_data FROM znotif_otf
                           INTO lv_otf_data
                          WHERE buskey EQ 'LS_000000000010001470'
                            AND ntftyp EQ '0037'
                            AND trntyp EQ 'ACT'.
    Get the length of the OTF data stored as stream of string************
      l_len = STRLEN( lv_otf_data ).
    Compute the OTF lines
      lv_lines = l_len / 72.
      lv_no_of_recs = lv_lines + 1.
    Set the offset to initial
      lv_offset = 0.
    *Reconstruct the OTF data from the string
      DO  lv_no_of_recs TIMES.
        IF sy-index NE lv_no_of_recs .
    Get OFT format: command ID
          ls_otfdata-tdprintcom  = lv_otf_data+lv_offset(2).
          lv_offset = lv_offset + 2.
    Get OTF format: command parameters
          ls_otfdata-tdprintpar  = lv_otf_data+lv_offset(70).
          lv_offset = lv_offset + 70.
        ELSE.
    Last line contains only the OFT format: command ID  "//" (End of file)
          ls_otfdata-tdprintcom  = lv_otf_data+lv_offset(2).
          lv_offset = lv_offset + 2.
        ENDIF.
    Append the OTF data to Export OTF table
        APPEND ls_otfdata TO lt_otfdata.
        CLEAR ls_otfdata.
      ENDDO.
    *************************Convert OTF to PDF**************************
    IF lt_otfdata IS NOT INITIAL.
      clear: lv_binfile,
             pdf_fsize.
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
        IMPORTING
          bin_filesize          = pdf_fsize
          bin_file              = lv_binfile
        TABLES
          OTF                   = lt_otfdata
          lines                 = lt_pdf_table
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDIF.
    Call screen***********************************
    Call screen
    CALL SCREEN 100.
    RETURN.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
    SET PF-STATUS '100'.
    SET TITLEBAR '100'.
    Convert bin file
      clear :l_len,
             l_offset.
      free l_pdf_data[].
    l_len = XSTRLEN( lv_binfile ).
    WHILE l_len >= 1000.
      l_pdf_line = lv_binfile+l_offset(1000).
      APPEND l_pdf_line TO l_pdf_data.
      ADD 1000 TO l_offset.
      SUBTRACT 1000 FROM l_len.
    ENDWHILE.
    IF l_len > 0.
      l_pdf_line = lv_binfile+l_offset(l_len).
      APPEND l_pdf_line TO l_pdf_data.
    ENDIF.
    Initialise and create the HTML container
      IF NOT g_html_container IS INITIAL.
        CALL METHOD g_html_container->free
          EXCEPTIONS
            OTHERS = 0.
        CLEAR g_html_container.
      ENDIF.
      CREATE OBJECT g_html_container
        EXPORTING
          container_name = 'HTML_CONTAINER'.
    Initialise and create the HTML control that will display the
    PDF output as URL
      IF NOT g_html_control IS INITIAL.
        CALL METHOD g_html_control->free
          EXCEPTIONS
            OTHERS = 0.
        CLEAR g_html_control.
      ENDIF.
      CREATE OBJECT g_html_control
        EXPORTING
          parent   = g_html_container
          saphtmlp = 'X'.
    Load the pdf data and obtain the URL
      CALL METHOD g_html_control->load_data
        EXPORTING
          size         = pdf_fsize
          type         = 'application'
          subtype      = 'pdf'
         IMPORTING
          assigned_url = l_url
        CHANGING
        data_table    = l_pdf_data
       EXCEPTIONS
          OTHERS = 1.
      IF sy-subrc NE 0.
       raise cntl_error.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
    Show the URL
      CALL METHOD g_html_control->show_url
        EXPORTING
          url      = l_url.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Edited by: Anandakumar.K on Oct 25, 2011 12:47 PM
    Edited by: Anandakumar.K on Oct 25, 2011 12:54 PM

    Hi,
    as you can see in SAP notes 842767 and 1349413, spool data cannot be converted properly for all types in a Unicode conversion.
    This might be possible if you have English (US7ASCII) characters only, but with Chinese characters I do not think that a small piece of code can do it ...
    Hence I think you need to recreate the data on the Unicode system ...
    Best regards,
    Nils Buerckel
    Edited by: Nils Buerckel on Nov 3, 2011 1:51 PM

  • Maximum character output size limit reached

    While importing data in Lumira using HANA based universes I am getting an error maximum character output size limit reached. Will appreciate any info on which server parameter controls this property. Attached the error message.

    Hi everyone,
    I believe Henry Banks discovered a solution for resolving this kind of error message. This is a limit which can be changed from within the "Web Intelligence Processing Server" from your CMC based on large amount of rows in your data. You can find his post about this here.
    It's roughly about half way down the page and I hope it helps.
    -Khuram

  • Generate a 12 bit digital output at DAQ output pin

    Hi 
      I have only a little knowledge in Labview
     I want to generate a 12 bit digital output at DAQ output pin , from a decimal number. I am using NI USB 6009
     Thanks in advance
      regards DK

    It seems to me that the same question was asked, answered, and marked as solved.
    http://forums.ni.com/t5/LabVIEW/Binary-output-at-t​he-digital-output-pin-as-1111-1111-1111/m-p/249969​...

  • Error message "Maximum character output size limit reach Err_WIS_30272"

    Users are getting the Error message "Maximum character output size limit reach Err_WIS_30272" while creating the Universe Query in the Live Office, but when they create the same query in the Web intelligence Report then it work fine.
    To resolve this error message we can have to increase the value of "Maximum Character Stream Size" parameter in the Web intelligence Processing Server.
    But i want to know the reason why the error message is only appearing in the Live Office Query, where it work fine in Web intelligence Query.
    Are there architectural difference in Web intelligence and Live Office?

    Hi,
    maybe one of the following SAP Notes will answer your Question.
    https://websmp230.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3133373030343526
    https://websmp230.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3133373537353526
    https://websmp230.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3133383336363426
    Regards
    -Seb.

  • 8 bit buffered output

    I would like to implement an 8 bit buffered output VI using a HS32 card and
    LabVIEW. The examples provided with LV only allow 16 bit buffered output
    (Digital DblBuffered Pattern Generation.vi).
    Thanks

    Sorry, I was wrong. It IS possible to have digital "buffered" output. You
    can use the 6533/PCI-DIO-32HS
    "Koen Hooogstoel" wrote:
    >I don't think it is possible to have digital buffered output. Buffered>output
    is only used in analog output>>>Mark Villela
    wrote in message>news:[email protected]..>>>> I would like to implement
    an 8 bit buffered output VI using a HS32 card>and>> LabVIEW. The examples
    provided with LV only allow 16 bit buffered output>> (Digital DblBuffered
    Pattern Generation.vi).>> Thanks>>

  • 2 Questions - Low Bit rate output. Low frames per second FPS, HELP! Live show sucked!

    I thought I had all of my settings set for a stream using FMLE running through stickam. Everything was looking good but when we went live our bit rate output went down below 100kbs. I had set it for high kbs but allowed it to drop size to keep frame rate. As you can imagine our video stream went from really good looking to choppy and almost freeze frame half the time. I have no idea what I did wrong. Is it my Cable Internet? My modem? I will say that I ran a speedtest.net test and although the download looked abnormally low I had 1.6Mbs upload which I thought should be sufficient? I'm not sure what to do.
    2nd question. I set FPS frame rate at 25fps but the output only allowed 15fps to the live stream. What is causing this? Is this a default number? It didn't seem what I set the frame rate at, the output was at 15fps. I saw ways to change the fps on the input but nothing on the output. What is the deal here?
    So... to recap. How do I keep the bit rates high and constant on a stream and how do I increase my fps on a stream. Or, to make it real easy, how do I get the best video stream picture that is not choppy or freeze frame. Our show is now starting to be sponsored by entities and I can't have bad looking shows. Can anybody lead me in the right direction?

    Whats your Encoding machine's configuration? I feel a low configuration machine can cause choppy streams.
    Did you try with any other video source?
    I feel you have enough bandwidth to stream.

  • Character output - Unix vs Windows

    We generate character mode report on Unix but we want to
    view the output using notepad in Windows. How do we
    generate the ASCII output on Unix such that it will have
    the CR/LF used by Windows?

    Alex,
    You would need to edit your prt file to get this.
    Try doing as below
    printer "dflt"
    after page control(L)
    return control(M)
    linefeed control(J)
    Thanks
    The Oracle Reports Team

  • 24 bit Audio through 16 bit Audio Output

    Possibly dumb question but...
    I have 24 bit audio files recorded on other equipment. If I edit them in Audition at 24/32 bit but my audio hardware and/or output driver is only 16 bit will that affect the audio processing quality of what I'm doing within Audition?
    The output is simply to connect speakers or headphones but everything else such as outputting the processed file to hard drive will be done internally from Audition (i.e. Save As - no mixdowns through external analog outputs or anything).
    Will the audio stay 24 bit quality when using 16 bit audio hardware output for monitoring?
    Thanks.

    No, the files within Audition will be unaffected by the available bit depth of your soundcard. The only time it would matter is, for instance, if you are making CDs from your audio files or feeding digital out to an external 16 bit recorder in which case you will need to down convert your 24 bit files to 16 using dither for best results when you have finished all the editing/processing. But keep the 32 bit files in case you need to go back and do any adjustments.

  • 24-bit analog output with Audigy Val

    Is it true that the Audigy Value does support 24-bit output only for digital out? Thanks.

    chapas wrote:
    Is it true that the Audigy Value does support 24-bit output only for digital out? Thanks.
    By the
    Comparison chart and
    Audigy 2 Value Specs, not true.
    jiitee

  • Additional Problem with Smartform Chinese Character Output

    Hi all!
    This is a follow-up to my earlier question about output of Chinese Characters in Smartforms.
    As a recap, my problem is to correctly output Chinese characters in my Smartform using English logon.  Using the OSS Note: 776507 that Anji sent, I managed to output in my Smartform preview the Chinese characters.  However, when I print a hardcopy, I still get the # characters.
    I tried uploading the font that outputs the chinese characters on MS Office, specifically Arial Unicode MS.  It was automatically assigned to the printer driver (I think).
    Is there anything I am doing or did wrong? 
    Thanks in advance for the help.  Points for any useful answer.

    Hi Pat,
    I have installed the lastest version of Adobe Reader (10.0.1) and Adobe Reader Font Pack (Asian Font Pack) and the results are as below:
    tested that the file (.pdf) cannot be displayed correctly
    It is appreciate if you have any idea for the issue. Thanks.
    Just let you know that the simplified chinese characters may inserted by the software (Free PDF Reader and Writer - Nitro Reader 3.1.1.3).

  • Character output problems.

    I'm currently writing a java console program that deals with european currency.
    The problem comes when I try something along the lines of the following (the printing of the currency symbol being the important part):
    import java.text.DecimalFormat;
    import java.text.DecimalFormatSymbols;
    import java.util.Locale;
    public class UnicodeTest {
      public static void main(String[] args) {
        Locale eu1 = new Locale("en", "GB", "WIN");
        DecimalFormatSymbols symbols = new DecimalFormatSymbols(eu1);
        DecimalFormat eu = new DecimalFormat(symbols.getCurrencySymbol() + "0.00", symbols);
        double number = 3f;
        System.out.println(number + " = " + eu.format(number));
    }The problem is that this should output 3 = ?3.00. It does on Unix systems but not on Windows,Windows end's up outputting an accented u (? (if this shows up on the forum) instead of the ? sign.
    It works in Windows when outputting to a window (i.e. TextArea, etc.) but not to the system console.
    Can anyone shed some light on this?

    Oh dear, those first and last question marks we're supposed to show up as pound signs (uk currency symbol).

  • To fix the size of a ui element to 32 bit character

    Hi all ,
       I have a scenario in webdynpro in which i have  to set a data coming from back end which may be more than 32 character so we have to display 32 character from the last(right aligned) and if necessary using the cursor we should navigate left or right in the data.if possible the  display UI element should be readonly .
    i tried changing all kind of properties.still couldn't get it..
    with Thank & regards
    Praveen.K.T

    Hi praveen,
            I can give you an close answer but may not be the right one.
          try following these steps.
    You can not make the ui element readonly and use the cursor to navigate the message
    1.you can set the context data property to readonly.
    To display the data try using the input field.
    Setting the input field properties
    2.You can set the lenght of the input field in the table to 32 characters
    3.Set the alignment property to forced right.
    4.Set the text direction to rtl(which means right to left).
    This will work fine but one problem is the cursor will move the other way which means when you press right direction key the cursor will move left and left direction key it will go right.
    Otherwise this is very much your scenario which your are looking for.
    Regards,
    Arunkumar

  • 24 bit audio output over USB

    I'm trying to stream hi resolution digital audio files (24/96 ) via a USB connection to my DAC. There is a software limitation of 16/48 it seems with the standard OS X USB drivers as the DAC only sees 16/48 via USB but can see 24/96 if I use the mini Toslink input. I would like to use this input for another source however. Is there any way around this? Any open source USB drivers that can handle 24/96?

    answered it myself!

  • Report output in character mode

    Hi,
    I have a group by report with sub totals after each grouping. I need this report output in a text file in character mode.
    The output looks fine, but the sub totals are not being displayed in character output format.
    When I run it to the screen then I do see the sub total. The report is developed in 10g.
    Please help.
    TIA.

    hi there
    go to property inspector of report and set correct setting in charactermode category.
    hope this helps
    asp

Maybe you are looking for

  • OB52 close posting periods

    All, Our finance people use transaction OB52 to close posting periods. This transaction very well might not be the correct one for my users to use. But  there is no way to restrict this transaction by company code. I checked the available objects to

  • WISM2-Cannot Login via WEB

    Hi everyone I cannot login the wism2 with browser. But I can use command to login the wism. like this: VSS-6509#session switch 2 slot 9 processor 1 The default escape character is Ctrl-^, then x. You can also type 'exit' at the remote prompt to end t

  • Switch jdk in IAS 10.1.3

    Hi, I've a IAS 10.1.3 installation, actually using JDK 5, I want to know where I can setup to use another JDK (1.4.2 in this case) Really thanks

  • Formatting a Thunderbolt drive

    I'm trying to set up a Lacie Thunderbolt drive as my recording drive from a Macbook Pro. At present the 4TB drive is configured as Raid 0, Extended Journaled. But I see Apple advising that a recording drive should be Unjournaled. Yet when I try to se

  • How to Create Approval for  New Business Partner Master Data

    Hello Experts, Is it possible for creation of an approval query such that while creation of New Business Partner: if   a user forgets to add data in a field say TIN No. which is present in Tax Information, then   the Business Partner Creation is with