ThrowNew() with Japanese chars went wrong

Hi All.
I want to throw exception that has Japanese chars from C++ code.
char szMsg[256];
// put Japanese chars into szMsg.
// ... and throw exception.
env->ThrowNew(exceptionClass, (const char*)szMsg);
Then, in Java code, it is displayed with unreadable characters like "????".
How can I get a readable string from C++?
Thank you.

Thank you for your reply.
But I'm not familiar with C++, could you tell me in detail?
My project is compiled with _MBCS option, and I tried to convert string to UNICODE to get readable string in JNI by using
(1) MultiByteToWideChar(...)
const char* szErrMsg = "...."; // including Japanese character
WCHAR szUnicodeMsg[256];
MultiByteToWideChar(GetACP(), 0, szErrMsg, -1, szUnicodeMsg,
sizeof(szUnicodeMsg)/sizeof(wchar_t));
env->ThrowNew(ExceptionCls, (const char*)szUnicodeMsg);
(2) mbstowcs(...)
mbstowcs(szUnicodeMsg, szErrMsg, strlen(szErrMsg)+1);
env->ThrowNew(ExceptionCls, (const char*)szUnicodeMsg);
(3) T2CW() macro
env->ThrowNew(ExceptionCls, (const char*)T2CW(szErrMsg));
Result
In case (1), unexpected string (like "B0D0F0H0J0?0") was displayed.
(by calling Throwable#getMessage() in JNI)
In case (2), only '?' was displayed in JNI.
In case (3), I got the same result as case (1).
Do you mean another way?
Thank you.

Similar Messages

  • WebUtil Using Client_Text_IO with Japanese chars

    Hi, I am trying to use Client_Text_IO to read text file with Japanese characters in it. But it seems like Client_Text_IO can't read Japanese chars properly. Can anyone tell me how to use Client_Text_IO with double byte
    chars like Japanese?
    Thanks in advance for any help.
    Tad Teramoto

    Hi Frank,
    Thank you for your reply. Could you be a bit more specific about what this bug 3075927 really is? Is this a problem only in handling files with muli-byte chars or does it have an effect on other functions? And is there any workaround for it?
    Thanks

  • Sorry, something went wrong - Open Office File from Search Results Page with Office Web Apps

    Hi,
    I'm getting "Sorry, something went wrong" error when I'm trying to open any office document from inside Search Results Page with Office Web Apps, the same error is appearing in the document preview as well.
    The error in SharePoint logs says that the file cannot be found.
    Please note that this error is coming only when the "Filename" of the document is not written in English (in my case its written with Arabic characters).
    If I try to open it from the document library, its opening properly with no errors.
    The only difference between two URLs (document URL in Search Results and in Document Library) is the value for "sourcedoc" attribute;
    In the case of Search Results page, the filename in "sourcedoc" attribute is kept as is with Arabic characters.
    While in the Document Library, the filename in "sourcedoc" attribute is converted into different characters (something like: "B9%D9%85%D9%8").
    Anybody have an idea on how to overcome this issue, implement a workaround or modify the "sourcedoc" behavior?
    Thanks in Advance.
    Hamza AlSughier

    Dear Wendy,
    Thanks for your efforts, I already tried your last suggestion before, but this didn't solve my problem.
    Actually my end users are accessing this portal using ADFS and HTTPS.
    Finally I got this solved, I have done below to get my overall solution working perfectly:
    - First I have configured Windows Authentication and ADFS Authentication on the same zone which is the default zone.
    - The issue when opening office documents with Arabic file name has disappeared as a result of first change.
    - Then I have faced an issue where we are not able to crawl content under Default zone, however we have to do so, after too many efforts, I found that its related to the Load-balancer/proxy, I have made the crawler server
    to crawl himself (http://CrawlServerName:PortNumber).
    - Also a change on Alternate Access Mapping was needed, I have set one of the extended zones (which is running Windows Authentication only) as Internal URL for the Default Zone, and this is was the URL I used for Crawling.
    I have configured Server Name Mappings to make sure we got proper URLs in Search Results.
    - Then we faced another issue, which is Authentication selection on login page (How to bypass this page, and authenticate using ADFS auto), I used this solution (Set Custom Sign In Page):
    http://0ut0ftheb0x.wordpress.com/2014/01/04/skip-the-authentication-selection-page-at-_logindefault-aspx-in-a-mixed-authentication-environment/.
    - I faced one more issue as a result of above workaround; Sign Out functionality wasn't working well; users get logged in automatically whenever I click on Sign Out. I solved this by modifying the "Sign Out" Control under _layouts;
    I made it to redirect users to ADFS Sign Out Page instead of SharePoint Sign Out Page (I know its not recommended, but I don't have any other option).
    Hamza AlSughier

  • After the latest update to Photoshop 2014, something went wrong and started spray-like black oil on canvas. I have deadline with cover. Can you help me please?

    How do I undo whatever went wrong after installing the latest update to Photoshop 2014 and suddenly when I tried to paint or touch up my illustration (book cover I'd drawn and painted, then scanned in and continued painting, changing. It's mostly done but I needed to send it like yesterday!!) OR touch up a photograph, black-like oily smudge-like substance sprayed around the point of the brush. I tried to fix by resetting but really didn't know what to do and probably made it worse. However, the problem happened after I updated the Photoshop Creative Cloud 2014 on my desktop 8.1 Windows and after a Tech helped update the regular CC Photoshop on my laptop 2007, 64 bit Windows to 2014. He promised to call back after giving it time to install but didn't for whatever reason on Friday. That happened to go up to the same update I did on my Windows 8.1 Windows. I have this deadline and really stressed. COULD IT BE THE UPDATE OR BOTH. REGARDLESS, CAN SOME EXPERT HELP ME UNDO WHATEVER THE UPDATE AND/OR I DID? I'm a God-gifted artist but only started using Photoshop CC, then updated to 2014--which, again, I like even better--when I began my monthly membership January or February 2014, although I had paid version 2002 and updated to paid version 2004 (ownership, not paid subscription like now). I've learned so much, including transforming, moving, stretching, with layers--all in the painting area with my illustrations--a little touch ups with photography.  MY EMAIL IS: [email protected] I really appreciate any help. This needs to be resolved today, the latest tomorrow--I could call tomorrow, however. I was chatting with a Tech support but lost him about an hour or less back. I have the case number and name and gave him my contact number, but they won't be in until tomorrow. He's supposed to give info and escalate the case. I really need an answer--if possible, today. It may require going back to before installing the latest update. THANK YOU KINDLY. Glena Jessee-King

    Update your graphics driver and/or turn off GPU acceleration in the Performance prefs.
    Mylenium

  • HT1267 While upgrading my iPhone 3 to 4.2 something went wrong and would not start at all. When tried to restore after going through th process it comes up with the message "The iPhone could not be restored. An unknown error occurred [1015]." What can I d

    While upgrading my iPhone 3GS to iOS 4.2 something went wrong and came up with the message "The iPhone could not be restored. An unknown error occurred  [1015]." Now it will not start at all. It just stays on screen with USB and the iTune picture. What can I do to get it going again. I only tried to upgrade because I was prompted to up-grade and now I am helpless. I did a backup before starting the upgrade. The error message did not tell what to do next.  Any help is very much appreciated.

    Usually that means the iPhone was hacked to unlock it from the original
    carrier .
    Updating the operating system locks it back to that original carrier
    You could try this
    http://support.apple.com/kb/TS3281
    However if the iPhone was hacked it is probably a paper weight  now
    and as this is an Apple hosted forum  you can get no further help here

  • What went wrong with Nokia Messaging?

    What went wrong with Nokia Messaging?
    In the beginning of this year I used Nokia Messaging on E71 and I really loved it!
    Since this autumn I am using it on my new N97 and I am confronted with totally different experience:
    - the application is very slooooow..
    - its unreliable - very ofter emails arrive with hours delay, a sync may take up to minutes
    - its very very buggy - truncated icons, diplay randomly jumping up and down, when scrolling.
    - very bad HTML display of emails - tiny (unreadable) default font and no wrap to screen when zooming - I thought emails were for reading?
    - many, many usability issues
    I just cannot believe it - How has Nokia managed to convert once such a good piece of software into such incredible disaster?
    Recently an update was published - I tried it immediately... To my big disappointment it contains all the same bugs and introduces new ones..
    How is this possible? What is happening at Nokia?

    Also my N86 as the same problem.
    And in global setting Nokia deleted the option to read always in HTML.
    And there is not any option to write html Mails

  • Office Web Apps Issue - "Sorry, something went wrong" message when opening a document (any MS docx,ppt etc) in IE. With Chrome, it pops (Microsoft Office needs your permission) message and on RUN, it opens the document.

    When opening any Microsoft documents ( docx, ppt etc) in SharePoint 2013,
    Internet Explorer behavior : "Sorry, something went wrong" An unexpected error has occurred message and then nothing happens. 
    In Chrome : Pops (Microsoft Office needs your permission) message and on clicking RUN, it opens the document.
    In Firefox : the documents opens, after asking which application do you want to use to open it.
    The feature (Open Documents in Client Applications by Default) is not activate.
    Why the MS documents are not working in IE 10?

    Hi,
    According to your post, my understanding is that you failed to open Microsoft documents in SharePoint 2013.
    I recommend to Run the following PowerShell in OWA Server :
    Remove-OfficeWebAppsHost # To Remove any restriction
    Or
    New-OfficeWebAppsHost -Domain <String> # To allow specific domain Name
    In addition, you can allow OAuth via HTTP using the following commands:
    $config = (Get-SPSecurityTokenServiceConfig)
    $config.AllowOAuthOverHttp = $true
    $config.Update()
    Here are two similar articles for you to take a look at:
    http://blogs.msdn.com/b/fabdulwahab/archive/2013/10/30/office-web-apps-with-sharepoint-2013-issues.aspx
    http://stevemannspath.blogspot.in/2013/03/sharepoint-2013-office-web-apps-issue.html
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • "Something went wrong with running Nokia Xpress" A...

    hello there,
    out of the blue the nokia xpress browser on my asha 501 does not start anymore: it just shows the blue background with the globe icon. when i press the back button, the following message appears:
    "Something went wrong with running Nokia Xpress"
    - I have subsequently updated the phone software to version 14.0.4
    - I have run the troubleshooter tool under "installed programmes"
    ("Debug <Ovi Browser> connecting on port 2800")
    - I have restarted the phone
    nothing helped.
    is anybody familiar with the problem and might assist with some help?
    thanks in advance
    *chris.

    Hi Chris,
    I had the same problem but I managed to solve this today (04/12).
    Follow the steps below:
    Be sure to backup your files.
    1. Settings (configuration) > Reset phone
    2. Click OK. Wait restart your phone.
    3. Run Nokia Xpress and DON'T upload your backup.
    I hope that your problem was solved.
    And, after this situation, when your phone ask to keep the old files of the browser, click on No.
    Bye,
    Pedro HSB
    If this helped you, please, give to me a Kudo Star, so I can contribute further, but, if this didn't help you, contact me and we gonna solve your problem together.

  • I purchased an used iPod nano 4th with many many songs on it,but when i hooked the usb cable to try and change the name,something went wrong.i had to reset it,thinking my music would still be there,but i lost everything! Is there any way to get these back

    I purchased an used iPod Nano 4th.with many,many,many songs and albums on it,but when i plugged the usb cable into my laptop(i am a new comer to computer) i thought i was changing the name and thought i was syncing but something went wrong and everything was gone! is there any way possible to get these back? Please I need Help!!! Thank you!

    Was the music purchased via your iTunes account and/or did you buy it from other sources or copy it from your own CDs, or did the music belong to the previous owner ? If the music was yours then you can sync it back to the iPod via your computer's iTunes. If the music is not still on your computer then have you got a backup of it ? If not then for iTunes purchases you might be able to re-download it depending on which country you are in. If the music was put on the iPod by the previous owner then you will need to buy your own copies of it.

  • "Something went wrong with your request. Please try again later."?

    I ordered a Retina MacBook Pro on the 24th. Today, I went to check the status of the order and it redirected me to https://secure1.store.apple.com/ie/order/sorry saying:
    Something went wrong with your request. Please try again later.
    The only place I can get to is the account homepage. Anyone have any idea whats wrong?
    Cheers.

    Hi Fionnr,
    If you are in USA then you can call them their toll free number 1-800-275-2273 or otherwise if you have an Apple ID then you can raise a request on https://expresslane.apple.com/GetproductgroupList.action
    They will help you further. 

  • Something went wrong with sync. between pc and Ipad now part of the information is gone on the ipad how do I put the backup from the pc to the ipad

    Something went wrong with sync. between pc and Ipad now part of the information is gone on the Ipad. How do I take the backup of the pc and put it back on the Ipad.

    Same thing just happened to me.  Help!

  • Something went wrong with my apple tv and now it says that it is in retail demo mode. How can i fix it?  I have had it for more than one year without any problem

    something went wrong with my apple tv and now it says that it is in retail demo mode. How can i fix it?  I have had it for more than one year without any problem

    To turn on/off retail mode, go to settings, general, legal.
    Do not open legal, just put the cursor there.
    Then, on the remote, type this sequence : right - right - left - center.
    The AppleTV should reboot.

  • I bought my i pod touch from us but i live in india .i have been using this from many days fr just a few days before something went wrong with it and the date and time has changed what do i do?

    i bought my i pod touch from us but i live in india .i have been using this from many days fr just a few days before something went wrong with it and the date and time has changed what do i do?

    Have you went to Settings>General Time&Date and correct the time.  Make sure the time zone is correct too.  Also go to Settings>General>Inernational and make sure the Gergorian calender is selected.

  • I keep getting the "Something went wrong" message on my Droid Razr HD also. I looked in my Settings, and I don't have a Cloud app - I have a Cloud Print app with nothing cached.  This is making it nearly impossible to use the phone - please help!  So far,

    I keep getting the "Something went wrong" message on my Droid Razr HD also. I looked in my Settings, and I don't have a Cloud app - I have a Cloud Print app with nothing cached.  This is making it nearly impossible to use the phone - please help!  So far, this website has only made things more difficult.

    The details you're providing are very helpful, Maj_Dad. With airplane mode enabled,
    there would be no message because that disables celluar data. I would recommend
    tying that mode with WiFi to see if it still happens. It sounds like this issue
    has something to do with one of the applications on the device.
    JoeL_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • I was re storing my iphone 4 something went wrong on my computer now my phone is showing the usb port cable icon with the arrow pointing to the i tunes symbol how can i get the phone from that mode ?

    ok i was re storing my i 4 something went wrong on the process now i have my phone showing the usb cable icon with an arrow pinting to i tuns icon ! how can i get my phone to go back to normal ???

    Put the device in DFU mode (Google it) and restore.

Maybe you are looking for