Problem in replacing with the unicode equivalent character ?

Hello,
I have a situation wherein i must replace
m with \u3005
n with \u3006
o with \u3041
etc ...,
I get the codepoint value from the multibyte represenation .
But the problem is
I can not replace
String temp="ename";
temp.replace('m','\u3005');
I am not allowed to hard code the value 3005, rather i am suppose to get the code point value from the multibyte representation.
I have no problem in getting the code point value from the multibyte represenation.
After i get the code point value i must concatenate the codepoint value with "\u"
Currently i am following this implementation to do the replacement,
String rp=null,snd;
String tmp="ename";
String hh="";
for(int i=0;i<tmp.length();i++)
snd=getCodepoint(tmp.charAt(i));
if(snd!=null)
rp=replace(String.valueOf(tmp.charAt(i)),
String.valueOf(tmp.charAt(i)),"\\u"+snd);
hh=hh+rp;
else
hh=hh+String.valueOf(tmp.charAt(i));
//The replace method
public static String replace(String source, String pattern, String replace)
if (source!=null)
final int len = pattern.length();
StringBuffer sb = new StringBuffer();
int found = -1;
int start = 0;
while( (found = source.indexOf(pattern, start) ) != -1)
sb.append(source.substring(start, found));
sb.append(replace);
start = found + len;
sb.append(source.substring(start));
return sb.toString();
else return "";
Please tell me how to do the replacement
Because when i display after the replacement is done i get
e\u3006a\u3005e for the string "ename"
where as i should be getting special characters in place of 'm' and 'n' in the string
or i must atleast get e?a?e for the string "ename"
Please do offer some suggesstions in this regard
Your suggesstions would be very useful
NOTE:
I am not suppose to make use of the method replaceAll( ) to do the replacements
Thanks and regards
khurram

I am getting these errors
i am not able to understand why
i looked into the java2 complete reference text
ther is no method called isHexDigit( ) in it
pleasae do help
the errors are as follows
[systpe@Agni ~]$ javac C1.java
C1.java:9: cannot resolve symbol
symbol : method isHexDigit (char)
location: class java.lang.Character
if(!Character.isHexDigit(ch))
^
C1.java:11: cannot resolve symbol
symbol : method digitValue (char,int)
location: class java.lang.Character
v |= Character.digitValue(ch, 16);
^
C1.java:15: replace(char,char) in java.lang.String cannot be applied to (java.lang.String,j
ava.lang.String)
String subs = "ename".replace("m", String.valueOf(cv));
^
3 errors
Thanks & Regards
khurram

Similar Messages

  • Latin characters such as 'à' must be replaced with the ASCII equivalent 'a'

    Hi,
    I struck up in my development at "Latin characters must be replaced with the ASCII equivalent".
    Do let me know the solution if any of you have implemented it before.
    Any kind of help is appreciated.
    Thanks
    MMK

    OK, more in detail ..
    I'm generating user ID based on First and Last name, if user enters latin characters as a part of his name, i should replace those LATIN characters with ASCII equivalent while generating unique user ID in the portal.
    A requirement for legacy system is that the user id's must contain only ASCII characters, therefore Latin characters such as 'à' must be replaced with the ASCII equivalent i.e. 'a'.
    I hope it is more clear ..
    Thanks
    MMK

  • My iPhone is having problems and I have to send it into Apple to get a fixed but in the mean while I need a phone. Could my old env touch act as a temporary replacement with the data plan? And if so how to I activate it with going to Verizon and once I ge

    My iPhone is having problems and I have to send it into Apple to get a fixed but in the mean while I need a phone. Could my old env touch act as a temporary replacement with the data plan? And if so how to I activate it with going to Verizon and once I get my IPhone back will I be able to activate it without going to the Verizon store?!? Thanks:)

    Im sorry. Im on my ipad and i didnt read that.
    Sorry again

  • My wife's iPad mini has a problem. When she types in the word 'sweet' in safari or Facebook it is auto replaced with the word ' f@€¥ing" the full word. Can anyone help

    My wife's iPad mini has a problem. When she types in the word 'sweet' in safari or Facebook it is auto replaced with the word ' f@€¥ing" the full word. Can anyone help

    Check her keyboard shortcuts:
    Settings > General > Keyboard > Check the shortcuts list

  • Why does my iPhone 4 not charge correctly?  Problem is definitely with the phone and not charges or chords.  Phone will charge but very slowly and no icon comes on.  Computer and iTunes doesn't recognize it a being connected.

    My iPhone 4 quit charging correctly.  It does charge but very slowly and icon doesn't indicate it as charging.  I've checked cables and charges and the problem is definetily with the phone.  My car stereo no longer recognizes it as a device.  Neither does the computer.  The real strange thing to me is that when I plug it into my old klispch speaker dock it will play songs.  My battery life is good when it is charged so I don't think its the battery. I've tried resetting the phone and cleaning the charging port.  I'm out of warranty.
    Would disconnecting the battery possibly reset it from some glitch or is the charging port got some bad contacts?

    I checked with the Genius Bar.  It was a new dilema to the lady that was helping me.  She took it to a back room and worked on it but it came out the same.  She gave me some options for repair or credit for replacement.
    I just kept the phone and put up with slowly charging it by plugging it in and then turning it off.
    I couldn't transfer anything from itunes.
    I finally got fed up and bought a new charging port for $10. and a toolkit for $3.  I looked up a video on youTube for the replacement and did it.
    That solved all the problems, it was the charging port, must have been some bad pins or something because it patially worked.

  • My iphone is synced and backed up with another computer which is now broken... and i have synced it with a new one but when i want to do anything itunes says all data will be erased and replaced with the current itunes library?what do i do?

    my iphone is synced and backed up with another computer which is now broken...i have synced it with my new computer  but it hasnt transfered anything over to itunes and when i try to add anything to my iphone it says all data will be erased and replaced with the current itunes? i dont want to lose all my apps and music.... i dont know how to go around this problem? i want to back it all up and sync it properly to my new computer so that is now my main computer , so i can add ring tones and music etc with out it erasing everything ive got. any answers would be great and muchly appreciated. thanks, im not sure what operating system my iphone has either.....

    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.
    Use your backup copy of your computer to put everything on the new one.
    It sounds like you have failed to do this, which is not good at all.
    You will have to transfer your itunes purchases from your iphone.  Authorize your computer for your itunes account 
    About iTunes Store authorization and deauthorization
    Open itunes, plug in iphone, do NOT sync, click File>Transfer Purchases
    When you do sync you will lose your pics ( photo library - synced from your old computer), your itunes content ( music, apps, videos,etc) , your contacts and your calendars.  So do NOT sync yet.  This is why a backup copy is so important.
    Enter one unique contact and calendar entry on your computer.
    When you first sync, you should get the option to merger the data.  Choose it.
    If you want your pics, then you will need to e-mail them to yourself before you sync.  They will not be of the original quality as they are reduced when synced to iphone.
    When all is as goos as it can be, then backup your computer, and always maintain the backup.

  • I have an alert message in disc utility. Error: storage system verify or repair failed. Problems were found with the partitian map which might prevent booting.

    While running verify disc in disc utility on 251 GB SSD SM256c Media I came up with this message: Alert system verify or repair failed. In the descriptions box of history it said, problems were found with the partitions map which might prevent booting. This is followed by a message in red reading, Error: Storage system verify or repair failed. At the time I was down loading raw pictures off my camera through a card reader across my computer to a relatively new 2TB Western Digital portable hard drive. after about 13 to 15 pictures downloaded that drive faileded. My Mac Book Air works fine, but i get this message now everytime I run disc verify on this disc. The Macintosh HD checks out fine.

    While running verify disc in disc utility on 251 GB SSD SM256c Media I came up with this message: Alert system verify or repair failed. In the descriptions box of history it said, problems were found with the partitions map which might prevent booting. This is followed by a message in red reading, Error: Storage system verify or repair failed. At the time I was down loading raw pictures off my camera through a card reader across my computer to a relatively new 2TB Western Digital portable hard drive. after about 13 to 15 pictures downloaded that drive faileded. My Mac Book Air works fine, but i get this message now everytime I run disc verify on this disc. The Macintosh HD checks out fine.

  • Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • When i go to sync my apps with my computer it tells me  ''are you sure you want to sync apps ? all exsisting apps and there data on (iphone) will be replaced with the apps on this itunes library'' does this mean all my data will be lost if i continue ?

    when i go to sync my apps with my computer it tells me  ''are you sure you want to sync apps ? all exsisting apps and there data on (iphone) will be replaced with the apps on this itunes library'' does this mean all my data will be lost if i continue ?

    Regarding your broken, previously authorized computer, here's how that works:
    You would authorize your new computer -- maybe you've done that already.  Then you will have two computers authorized.  Apple allows you to have up to five computers authorized at any time.  If you get to five, you can then go to your account details in iTunes and remove all authorizations.
    Bear in mind this is not saying you can synch to more tham one library.  Razmee209 and gdgmacguy's comments above are correct.  But if Apple only allowed you to authorize one computer at a time, then having a broken computer would mean you could no longer use your Apple ID with iTunes.

  • Having installed an upgrade for Photoshop Elements 13, I cannot open the application. I get an error message saying "Adobe Photoshop Elements Editor cannot be opened because of a problem. Check with the developer to make sure Adobe Photoshop Elements Edit

    Having installed an upgrade for Photoshop Elements 13, I cannot open the application. I get an error message saying "Adobe Photoshop Elements Editor cannot be opened because of a problem. Check with the developer to make sure Adobe Photoshop Elements Editor works with this version of OS X. You may need to reinstall the application. Be sure to install any available updates for the application and OS X".
    I have since uninstalled and reinstalled the app, but get the same error message.

    Which version of OS X do you have? It's not clear from your post whether "installed an upgrade" means you just installed PSE 13 as an upgrade or you installed an update to PSE 13, like ACR 9 or 13.1. Please clarify.

  • Hi there, I cannot open bridge and I get this warning, "Adobe Bridge Cannot be Opened because of a problem. Check with the developer to make sure Adobe Bridge CC works with this version of Mac OS X. You may need to reinstall any updates for this applicati

    Hi there, I cannot open bridge and I get this warning, "Adobe Bridge Cannot be Opened because of a problem. Check with the developer to make sure Adobe Bridge CC works with this version of Mac OS X. You may need to reinstall any updates for this application and Mac OS X" although bridge has been running on my Mac for over a yera. I have installed all current updates for Mac and reinstalled Bridge again from CC and still get the same issue? Any advice?

    Would you please provide details about your setup?
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • I have tried VERY unsuccessfully to install iphoto 9.2.3 update...it says it has successfully updated - then on opening says: iPhoto cannot be opened because of a problem. Check with the developer to make sure iPhoto works with this version of Mac OS X.

    I have tried VERY unsuccessfully to install the new iphoto 9.2.3 update.
    I have installed it several times both from the appstore and from Apple Support downloads...it says it has 'successfully updated' - then on opening iphoto, a dialogue box pops up and says:
    iPhoto cannot be opened because of a problem.
    Check with the developer to make sure iPhoto works with this version of Mac OS X. You may need to reinstall the application. Be sure to install any available updates for the application and Mac OS X.
    Click Report to see more detailed information and send a report to Apple.
    Insane...I have all my updates including Lion 10.7.3 why does APPLE KEEP SENDING BETAS AS A REAL PRODUCT?
    Does anyone know how to copy over a backup from a twinned drive Backup? What files etc.
    Thanks tons...

    Thanks Terence,
    I did get it working finally...and your last advice was what I needed.
    I am embarassed that I was an early adopter...SHOULD HAVE KNOWN BETTER and read the problems before creating some for myself.
    This was an excercise in frustration, because of the obtuse division between the appstore and Apple Support downloads... it was a bit of a circuitous route...strange that with all the security reciepts and tracking that Apple goes to to prevent piracy... which Steve by his own admission used to build Apple...
    Why aren't the server scripts smart enough to say…”HEY DUMMY you can't use this download because you purchased the last iPhoto upgrade from the appstore...and… DON'T WASTE YOUR TIME and precious data BUDGET downloading this gargantuan file which will eat 20% of your expensive 5Gb monthly data allotment!!!…and NOT WORK…only pretend to…and then foul your system….kill your productivity and turn your hair whiter…even worse than LION did.
    I am just so antagonized by the inept scripts in recent installations that don't do a diagnostic before allowing installation that is going to corrupt things...I had less effort and frustration when I ran my ATARI with a MAC emulator...rarely lost any productivity to nonsense.
    I AM TIRED OF BETAs dressed as products...designed and rushed out for Apple toys that once were tools of the creative trade...COREL...may still have a chance at a comeback if Apple keeps pumping out toys instead of the venerable tools we once adored as income enhancers.

  • Problem in Connecting with the server

    I have a problem while sitting the e-mail. A message comes saying that the device had a problem in connecting with the server. My BB is Tourch 9860
    Please help me

    Hi gaf4u
    Welcome to BlackBerry Support Forums
    Do you already have any email account integrated with your device ?
    If not then do you have a specific BlackBerry data plan / BIS from your Carier on your account ?
    let us know.
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • Problem in query with the u0091Document numberu0092

    Hi,
    I got problem in query with the ‘Document number’
    There are three columns in the cube 1) Document number 2) Country 3) Count
    In the cube there are multiple entries for same document number as below.
          Document number            country          Count
         10000               US          1
         10001               US          1
         10002               US          1
         10002               US          1
         10002               US          1
         10003               UK          1
         10004               IN          1
         10004               IN          1
    When I ran the query on this cube for country US it shows count as 5 but I want count as 3 (i.e. it has to take count only once for the same document no’s)
    Similarly for country IN I want count as 1

    Hi,
    You have to create a counter based on the document number (exception aggregation). There is a How-to paper available for this. It is called: How-to...count the occurences of a characteristic.
    Regards,
    P.

  • Trying to collect rewards from a survey site. told problem may be with the browser. I don't know what to do.

    trying to collect rewards from a survey site. told problem may be with the browser. I don't know what to do.

    Hi,
    Please [https://support.mozilla.org/en-US/questions/911441 see this.] You may also want to check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode.]

Maybe you are looking for

  • IDVD 6 disk image incorrect

    I created a slideshow in iPhoto 6, exported it to iDVD, created the opening page, used Preview, everthing looked fine. However, the resulting file does not play correctly. The opening shows up, but if I hit enter or play it will not play the movie. T

  • Apple 17" M7649 LCD Monitor &  iMac G5 iSight to Mirror

    Hi Gang, Need to pick your brains. I have a studio that I need to run a second monitor off my iMac G5 iSight 2.1Ghz. I know I can only run it as a mirror. I have picked up an apple 17" M7649 HD LCD Display from ebay for $20 ... How do I connect it to

  • Tables for balance sheet figures

    friends, in which table the data in f.01 balance sheet and profit and loss account data is stored, how to pick this data from tables and which fields are required to write z program for balance sheet and prift and loss account, regards,

  • Adobe form not dispalying content in portal

    Hi Experts, We have one issue in Portal. One user clicked on UWL item in portal its opening subscreen as like behaviour. In subscreen adobe form its not displaying any content and its displaying only approve and reject buttons. we checked user browse

  • Are Weblogic Workshop API's exposed to developers ??

    hello all, Our project has a requirement to develop customized portal framework that allows GUI designers to create and deploy new websites. Our proposed solution mimics the behaviour of BEA portal Workshop. In this direction I would like to know whe