Form English Char ( Single Byte  ) TO Double Byte ( Japanese Char )

Hello EveryOne !!!!
I need Help !!
I am new to Java ,.... I got assignment where i need to Check the String , if that string Contains Any Non Japanse Character ( a~z , A~Z , 0 -9 ) then this should be replaced with Double Byte ( Japanese Char )...
I am using Java 1.2 ..
Please guide me ...
thanks and regards
Maruti Chavan

hello ..
as you all asked Detail requirement here i an pasting C code where 'a' is passed as input character ..after process it is giving me Double Byte Japanese "A" .. i want this to be Done ..using this i am able to Convert APLHA-Numeric from singale byte to Doubel Byte ( Japanse ) ...
Same program i want to Java ... so pleas guide me ..
#include <stdio.h>
int main( int argc, char *argv[] )
char c[2];
char d[3];
strcpy( c, "a" ); // a is input char
d[0] = 0xa3;
d[1] = c[0] + 0x80;
printf( ":%s:\n", c ); // Orginal Single byte char
printf( ":%s:\n", d ); // Converted Double Byte ..
please ..
thax and regards
Maruti Chavan

Similar Messages

  • To find out whether a character is of Single byte or Double bytes

    hi,
    is there any built-in class to find whether a character is a single byte or double byte. is there any method to do so?? If possible can someone provide a sample code snippet to do a check for single byte and double byte characters.
    thanx in advance.....

    If you are asking what size the char primitive is, it's 16 bits.
    If you want to know the numerical value of a char, you can cast it to an int and compare it to 255 to see if it fits in 1 byte.

  • How do I convert a double-byte encoded file to single-byte ASCII?

    Hello,
    I am working with XML files (apparently coded in UTF-8) which encoded in double-byte characters.
    The problem is the characters for end of line: 00 0D 00 0A
    This double byte end of line is causing a problem with a legacy conversion tool (which deals with 0D 0A). The file itself contains no
    accented/international characters, so in principle converting to single-byte should not cause any problems.
    I have tried to convert this file with tools like native2ascii and the conversion tools that are part of Notepad++ but without
    any luck - the "00 0D 00 0A" are still present in the output
    Can anyone point me to a tool or some code that can convet this file into single-byte?
    Thank you.

    Amiens wrote:
    native2ascii.exe -encoding UTF-16 -reverse INPUT.xml OUTPUT.xml
    gives 00 00 0 0D 00 00 00 0A
    so clearly that is not the required output.What you've got there is UTF-16 encoded text that's been converted to UTF-16. Get rid of the "-reverse" option and you should see the result you expect.

  • Oracle Multi-Bytes vs Single-Byte

    Hi,
    We have to add japanese to our application, i had succesfully add japanese data in our single-byte database,
    so why should we use a Multi-byte DB?
    what is the gain to use a Multi byte DB vs a Single Byte?
    does intermedia work with japanese in Single Bytes?
    Is utf8 the best way to have an international DB?
    We will have to add a lot of other char-set in the future.
    Thanks

    so why should we use a Multi-byte DB?
    what is the gain to use a Multi byte DB vs a Single Byte? What you are doing is storing invalid multibyte characters into a single byte database. So each double byte Japanese characters are being treated as 2 separate single byte characters. You are using an unsupported but common garbage in garbage out approach, so in that sense you are using Oracle as a garbage container. :)
    Let's look at some of the issues that you are going to have :-
    All SQL Functions are based on the property of the single byte database character set WE8ISO8859P1. So LENGTH(), SUBSTR (), INSTR (), UPPER(), NLS_UPPER etc .. will yield incorrect results . For example a column with one Japanese character and one ASCII character will return a length of 3 characters rather than 2 characters. And if you want to locate a specific character in a mix ASCII and Japanese string using the SUBSTR() it will be very difficult, because to Oracle the string consists of all single byte characters, it will not skip 2 bytes for a Japanese character. Even if you don't have mix strings, you will need to write one routine for handling ASCII only and another for Japanese strings.
    Invalid Data conversion , if your need to talk to another db using dblink say ,all the character conversion will be based on the single byte character set to the target database character set mapping, so the receiver will lose all the source Japanses characters and will get 2 single byte characters for each Japanese char instead .
    Export and Import will have identical problems, character set conversion are performed during these operations, so all Japanese characters will be lost. This also means that you can not load correctly encoded Japanese data into your current single byte DB using IMPORT or SQLLOADER without data corruption ...
    does intermedia work with japanese in Single Bytes?No
    Is utf8 the best way to have an international DB?Yes
    null

  • Single byte languages

    Hello,
    I have a web application that is internationalized to a certain degree, in that it can be easily localized, as long as the language does not use a double-byte character set. For purposes of the product specification/documentation, how would I go about obtaining a complete list of the "single-byte" languages that such an application would support? (ie, English, Spanish, French, German, etc.) I haven't been able to obtain this list via a simple Google search, as I had originally suspected.
    Thanks!

    Hello,
    I have a web application that is internationalized to
    a certain degree, in that it can be easily localized,
    as long as the language does not use a double-byte
    character set. Huh? Why would that be a limitation? Neither java nor browsers are limited in that way.
    For purposes of the product
    specification/documentation, how would I go about
    obtaining a complete list of the "single-byte"
    languages that such an application would support?It doesn't have anything to do with "languages". It has to do with charsets.
    It it possible that english alone has several hundred unique charsets. I would suspect that other languages have more than a couple each.

  • Faster way to migrate from Single byte to Multi byte

    Hello,
    We are in the process of migrating from a 9i Single byte db to a 10g Multi byte db. The size of our DB is roughly 125 GB. We have fixed everything in the source database (9i) in terms of seamlessly migrating from a single byte to a multi byte db. The only issue is the migration window - curently we are doing an export/import since there is a character set migration involved and it's taking about 20+ hrs to do the import in 10g. The management wants to cut this down to less than 10 hours, if that's possible. I know the duration it takes to import depends on many factors like the system/OS configuration, SAN, etc but I wanted to know what , in theory, is considered the fastest method of migrating a database from single byte to multi byte.
    Have anybody here gone through this before?
    Thanks,
    Shaji

    If the percentage of user tables containing some convertible data (I am assuming you will not have any truncation or lossy data) is low, you can export only those tables, truncate them, and rescan the database. This should report no convertible data, except some CLOBs in Data Dictionary. Such database can be migrated to AL32UTF8 using csalter.plb. After the migration, you import only the previously exported subset of tables.
    Note, for this process to work, no convertible VARCHAR2, nor CHAR, nor LONG data can be present in the Data Dictionary.
    The process should be refined by dropping and recreating indexes on the exported tables as recreating an index is faster then updating it during import. You should also disable triggers so that they do not interfere with the migration (for example, they should not update any "last_updated" timestamp columns).
    If the number and size of affected tables is low compared to the overall size of the database, the time saved may be significant.
    There may also be tables that require even more sophisticated approach. Let's say you have a multi-gigabyte table that stores pictures or documents in a BLOB column. The table also has a single text column that keeps some non-ASCII descriptions of the stored entities. Exporting/truncating/importing such table may be still very expensive. A possible optimization is to offload the description column to an auxiliary table (together with ROWIDs), update the original column to NULL, export the auxiliary table, drop it, rescan the database, migrate with csalter.plb, re-import the auxiliary table, and restore the original column. If pictures alone occupy, for example, 30% of the whole database, such approach should yield significant time saving.
    -- Sergiusz

  • Unable to generate single byte character when used TO_SINGLE_BYTE

    Hi All,
    Can anyone help me in getting the output for the below single byte query. When tried it says INVALID NUMBER.
    Step 1 :-
    select RAWTOHEX('2Z') from DUAL; -- 325A
    Step 2:-
    SELECT TO_SINGLE_BYTE(CHR('325A')) FROM DUAL;
    The above query when executed it says "ORA-01722: invalid number".
    I tried using VARCHAR2 instead of CHR it throuws the below exception,
    "ORA-00936: missing expression".
    But the same query if no characters are passed is working fine.
    SELECT TO_SINGLE_BYTE(CHR('3251')) FROM DUAL;
    Thanks,
    Ravi

    TO_SINGLE_BYTE is used to convert multi-byte characters to single-byte characters. '325A' is not a multi-byte character so can't be converted.
    Use HEXTORAW to convert the hex value back to a raw value.

  • Acrobat replaces single-byte character codes with octal strings in content stream, how to prevent?

    I have thousands of PDFs, mainly text, all fonts are subsets, indexes starting from 1. In page content stream I see character indexes represented as single bytes: binary 1, 2, 3, etc. But, after optimizing files with Acrobat (I use it to save to 1.6 version with compressed object streams etc.) those single bytes become octal strings like \001, \002, ... . Raw stream size is increased by factor 1.5, and after a flate filter there is still 1-2 kB increase for each page. As there are thousands of pages, total (and totally useless) increase is considerable and doesn't go well with my goal of creating as small package as possible.
    Can this behavior be prevented (with something like registry setting)?

    what are you calling getBytes() on?he's calling getBytes() on his String object.
    @ puneet_k,
    I don't have a solution but note that on Unix-like systems a newline is a single byte 0x0a and on DOS-like systems (Windows) it is a sequence of bytes 0x0d and 0x0a.
    Some text editors handle both.
    I'm not sure but I think on Unix,
    new String("\n").getBytes() equals new byte[] { 0x0a }
    and on DOS
    new String("\n").getBytes() equals new byte[] { 0x0d, 0x0a }

  • How to get a decimal number from three single byte numbers

    i'am in a difficult situation. I have motor which provides me the number of steps moved as three numbers of length one byte.I 'am attaching the program with this message. Here the commands from index 2-4 outputs will provide the number of steps moved. But these are numbers with a single byte length(<256). So how can I get the corresponding decimal number from these three single byte length numbers. please reply
    Attachments:
    stop2.vi ‏11 KB

    Without knowing what motor you are using, I'm guessing that you probably need to use the Join Numbers to combine the bytes into a U32.  The other option is to use the Type Cast function.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to replace single backslash(\) to double backslash(\\)

    Hi
    I want to replace single backslash to double backslash from the string.
    Code is here
    String data="File name :\n.txt;File name:\t.txt";               
    data = data.replace("\\","\\\\");
    System.out.println("-->" +data);
    i tried to this code but its not working. Help me if anyone is know.
    Please reply me asap.
    Thanks

    DVekaria wrote:
    Are you not getting my question.Obviously not. That's why we've asked you to clarify it. Twice, at least.
    whatever data contenting in Variable, it must print as its on the screen.This code does that.
    String s = "a\nb\tc;"
    System.out.println(s);The variable s contains a reference to a String object. That String object holds 5 characters: 'a', newline, 'b', tab, 'c'. The println prints out exactly what's in that String--those 5 characters. Note that there is not even one single backslash in that String.
    a
    b cThis is exactly what you asked for.
    Now let's say I create a file in Notepad, and I type the following, and then save it:
    a\nb\tcThat file contains 7 characters. 'a', '\', 'n', 'b', '\', 't', 'c'. If I read that file with Buffered reader, it will give me a String object with those same 7 charcters. If I print it out it will print out those 7 characters.
    a\nb\tcNote that in both cases, I am printing out exactly what is in the String.
    Think carefully on what is the same and what is different between those two cases, and use it to form a clearer definition of your problem. Remember, we want to know what you're trying to accomplish. Just saying "I want to replace backslashes" tells us how you're trying to solve your problem.

  • How to hide the Form Feed char in JTextArea

    We have reports (written in C) that are being displayed in a JTextArea.
    In our old app, the Form Feed character (ASCII 12) was invisible naturally without having to code around it. In a JTextArea, it appears as a "[]" character. Does anyone know how to make this character invisible to the JTextArea? Removing it is not an option, as it is needed for it's print routine.
    I've been searching these forums and the web all morning with no luck.

    Not sure how the Form Feed character worksIt lets the printer know that a new page is to be started at that point.
    Does it always appear with the New Line character?Usually but not always.
    Thanks for the reply. It's more involved than just printing standard lines of text, so perhaps I should have been more clear.
    The C report already has pagination built in from when it was run from our legacy GUI. In other words, each report knows how many chars wide and how many lines down each page will be. It is different for each report, but they all hover around 150 chars wide and 60 lines down per page, since they are all presented to the user (and printed) in landscape.
    In the C code: at the end of each report line a "\n" is appended. At the end of each page, an ASCII 12 character is appended. A header is at the top of each page (different for each report, but usually 2 or 3 lines) that shows the page # and other info.
    So, as you are viewing the report, you would see page 1 header, some report content, page 2 header, some more report content, page 3 header, etc. as you scroll down.
    So now if you view it in Java: if the user wishes to print, the report is sent to our ReportPrinter class, who tokenizes the report based on "\f" and makes a ReportPage object (implements Printable) for each token. Each ReportPage is then appened to a java.awt.print.Book object, who in turn is sent to the PrinterJob.
    Given that the report already has his pages figured out and has a form feed char at the end of each page, the report comes in to the JTextArea with [] chars preceding each page header (approximately every 60th line, depending on the report).
    I tried using a JTextPane, but no luck. It was also much slower reading in the report. I just want the textpane to not display the non-printable characters ("\f" in this case).

  • String value changes single quote ' to double quote "

    I am creating a list with different bill codes within single
    quotes as follows
    <cfset corlist = " '1100 ','1200 ','1300 ','1700 ','1800
    ','1950 ','7001 ' ">
    when I do an output
    for
    <cfoutput>AND idbillcode IN ( #corlist
    #)</cfoutput>
    I get the values as follows
    AND idbillcode IN ( '1100 ','1200 ','1300 ','1700 ','1800
    ','1950 ','7001 ')
    However when I put the same string within a cfquery the
    single quotes get replaced by double quotes as follows
    AND idbillcode IN ( ''1100 '',''1200 '',''1300 '',''1700
    '',''1800 '',''1950 '',''7001 '') which throws an error.
    Anybody has any clues.
    Thanks.

    However when I put the same string within a cfquery the
    single quotes
    get replaced by double quotes as follows
    AND idbillcode IN ( ''1100 '',''1200 '',''1300 '',''1700
    '',''1800
    '',''1950
    '',''7001 '') which throws an error.
    Anybody has any clues.
    That is ColdFusion escaping the single quotes, by doubling
    them so that
    you can search for strings such as "singhpk's code does not
    work".
    (Note the single quote/apostrophe that would normally break
    this string
    if it was not escaped.
    To tell CF not to do this, one uses the
    preserveSingleQuotes() function.
    The documentation has all the details.

  • Generate and Print Preview Multiple Forms in a Single PDF

    There have been other questions similar to this but none directly address my problem.  We have the need to generate multple forms in a .pdf using Adobe interactive forms.  We can generate the multiple forms, but the user has to click on each form to view.  They want to have the forms in a single document that they can scroll through before printing.  We can do this in SmartForms but need to do it in Adobe.  Does anyone know how to generate multiple forms, either multiple copies of the same form or various forms, from an ABAP program into a single pdf that can be print previewed, in scrollable form, by the user?

    I can describe it one more time, I think:))
    You have multiple options, but only one "reasonable" within SAP.
    You can call an external application (through command line etc.) to concatenate forms for you.
    You can use iText as mentioned in the thread, and write yourself a "tool" which will concatenate the forms for you.
    Both these "options" would not be acceptable for my clients, I name them to help you get the whole picture.
    Then there is the third option: use a form for a single instance (template/ form A) and create a new form (form B), where you will use the A template:
    - you need to: create a new interface where everything from the old interface is a row of the table (example: you have a form to print out the personal card of the employee, so in a new form you will need to use a table, where a row is an employee)
    - you need to create a new form layout based on the new interface:
    in this new layout you will paste the whole layout of the old form (A/ single instance) and wrap it into a subform. The added subform will work as a table (you will bind that to the table from interface) and everything from the old template within this new subform will work as a "row" (something what you can repeat for each data item).
    Does that sound reasonable?
    Cheers Otto

  • Simultaneously Connecting Multiple Tables of the same Database to Textboxes of the same Form using a single ADO Control Code using VB6 Enterprise Edition and MS Access 2007

    Iv 10 Tables consisting of atleast 10 fields each in a single Database. Bt, Im only able to connect 1 table at a time to a form using an ADO Control. Im able to add data from table 'student' to text-boxes in my form. Bt, hw can I add data from field(0) of
    Table 'Student' to Textbox1 and data from field(0) of Table 'Marks' to Textbox2 using VB6??
    This is the current sample coding iv got to connect a single table to a form:
    Global con As New ADODB.Connection
    Global rs As New ADODB.Recordset
    Public Function Connect()
    If con.State = 1 Then con.Close
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\bca.mdb;Persist Security Info=False"
    End Function
    Private Sub Add_Click()
    If rs.State = 1 Then rs.Close
    rs.Open "select * from student", con, adOpenDynamic, adLockOptimistic
    rs.AddNew
    rs.Fields(0) = (Text1.Text)
    rs.Fields(1) = (Text2.Text)
    rs.Fields(2) = (Text13.Text)
    rs.Fields(3) = (Text4.Text)
    rs.Fields(4) = (Text5.Text)
    rs.Fields(5) = (Text6.Text)
    rs.Fields(6) = (Text7.Text)
    rs.Fields(7) = (Text8.Text)
    rs.Fields(8) = (Text9.Text)
    rs.Fields(9) = (Text10.Text)
    rs.Fields(10) = (Text11.Text)
    rs.Update
    MsgBox " Record Added"
    End Sub
    What can I do to add fields from 2 different tables to different text boxes within the same form using a single ado control using vb6 and MS Access 2007??

    Hi,
    Since VB6 product is not supported in this forum, you may go to these forums for support:
    #Where to post your VB 6 questions
    http://social.msdn.microsoft.com/Forums/en-US/6a0719fe-14af-47f7-9f51-a8ea2b9c8d6b/where-to-post-your-vb-6-questions
    Thank you for your understanding.
    Best regards,
    Franklin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can you have multiple contact forms in a single Muse site?

    I have a site created in Muse that needs to use multiple contact forms of a sort.  One is a simple contact form.  Two others are sign up forms. In two of the three forms I have to separate the First and Last names.  Also in those there are multiple Custom fields and Message fields.
    The original simple contact form is working fine and has been.  However, I modified one of the pages by adding a second form, the first of the two sign-up forms.  It looked great in Muse, but when uploaded to the site, all of the fields were gone, leaving only the Labels in a single paragraph.
    Does this mean I can't have multiple contact forms in a single site?  If I actually, can, then what might have caused the problem?  And what could you suggest for me to try to fix it?
    Thank you,
    Laura

    Thank you for the information, but I cannot find anywhere in help where to find the field names (if that is my problem).  I changed all the labels and the corresponding text inside the field (remember, Muse does not give access to code as far as I can tell).  When I preview the page in a browser (using FireFox as default, but also tried with IE), everything looks good.  When I export to html and open the index.html on my computer, everything still looks great.  But when I FTP the page to the website, this is what I get:
    First Name:RequiredRescuer Email:RequiredOrganization (if any):RequiredSubmitting Form...The server encountered an error.Form received.Geographic Areas Covered:RequiredRescuer Cell Phone:RequiredRescuer Home Phone:RequiredRescuer Home Address:
    RequiredRescuer City:RequiredRescuer State:RequiredRescuer Zip code:RequiredRescuer Country:RequiredVeterinarian Name:RequiredVet Address:RequiredVet City & State:RequiredVet Phone:RequiredRequiredServices Offered:RequiredAdditional Info About You:Required Rescuer (available to general public) RequiredVolunteer (available only to Rescuers)RequiredPhoneRequiredEmailRequiredOtherRequiredLast Name:RequiredImage Verification:Required
    How would you prefer to be listed?
    How would you prefer to be contacted?
    However, this is how it looks on the preview:
    So, what is my problem?  And how can I fix it?
    Thank you,
    Laura

Maybe you are looking for

  • Itunes 10.0.1.22 does not find Iphone 4

    i had the older itunes10 before downloading the new one acouple of days ago. when i went to sync my phone today, it didnt recognize my iphone 4 at all! i tried it all, ive been online for the past 5-6 hours trying to figure out why itunes doesn't see

  • Can i install Oracle ADF Essentials 11.1.2.3 on weblogic 10.6 ?

    can i install Oracle ADF Essentials 11.1.2.3 on weblogic 10.6 ? what the difference between ADF Essentials 11.1.2.3 and Application Development Run time 11.1.1.6 ? can i use ADF Essentials 11.1.2.3 instead of Application Development Run time 11.1.1.6

  • FM REUSE_ALV_GRID_DISPLAY - runtime error

    I get the following error when I use FM REUSE_ALV_GRID_DISPLAY: "Field catalog not found". I realize that it is looking for the parameter it_fieldcat but I don't remember ever passing that parameter before; it also says that it is optional.  Below is

  • Apex Versioning

    Is it possible to compare 2 Application Export files and generate a report detailing the differences between the 2 Exports ? I am tyring to push APEX as a RAD tool and the infrastructure/architecture folks insist that they need to know what pages/ite

  • Maintaining Unit of Measure (not alternative)

    Dear colleagues, I need to maintain a unit of measure (1 BOT is equal to 45 DEG) where we are going to use it for Z programsu2019 calculations, not in standard functions.  But I don't want to maintain this ratio under additional data  units of measu