472,778 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,778 software developers and data experts.

Transcode Japanese??

I'm on a Solaris 9 Japanese machine w/ an Ultra 5 Sparc CPU. I'm using
Xerces 2.6 DOM

I've got a document in UTF-8 format..
<?xml version="1.0" encoding="UTF-8"?>
<Name>ja_alert-\343\201\250\343\201\241\343\201\244\343\201\252\3 43\201\256\343\
201\253</Name>
(I'm not sure if the Japanese came out right here, but everything after
ja_alert- is UTF-8 for Japanese).

When I extract the text element I get an XMLCh* that claims to be 15 char's
long. However, when I get a char* from it, all the Japanese is truncated and
it comes out only 9 chars long.

char * value = XMLString::transcode( pNode->getNodeValue() );
cout<<"original length is "<<strlen( value )<<endl;
cout<<"Its a text named
"<<XMLString::transcode(pNode->getNodeName())
<<" value "
<<XMLString::transcode(pNode->getNodeValue())
<<" size is "<<XMLString::stringLen( pNode->getNodeValue())
<<endl;

I get back...

original length is 9
Its a text named #text value ja_alert- size is 15

(notice the Japanese is gone).
My locale looks like...
=> locale
LANG=ja
LC_CTYPE="ja"
LC_NUMERIC="ja"
LC_TIME="ja"
LC_COLLATE="ja"
LC_MONETARY="ja"
LC_MESSAGES="ja"
LC_ALL=
Do I need to something to tell the transcoder what encoding to transcode
to??

-Robert
Jul 20 '05 #1
2 1589
Opinion 1 :

If you "overwrite" load/save nomen klatur re: characters

you will render the contentType useless.

It will not render.

======

Opinion 2 :

If this tripple digit backward slash multiple Garbage
was supposed to be ANY UNICODE or JAPANESE,

then I live on the moon.


"Robert M. Gary" <fo****@foobar.com> wrote in message
news:11***************@cswreg.cos.agilent.com...
I'm on a Solaris 9 Japanese machine w/ an Ultra 5 Sparc CPU. I'm using
Xerces 2.6 DOM

I've got a document in UTF-8 format..
<?xml version="1.0" encoding="UTF-8"?>
<Name>ja_alert-\343\201\250\343\201\241\343\201\244\343\201\252\3 43\201\256\
343\ 201\253</Name>
(I'm not sure if the Japanese came out right here, but everything after
ja_alert- is UTF-8 for Japanese).

When I extract the text element I get an XMLCh* that claims to be 15 char's long. However, when I get a char* from it, all the Japanese is truncated and it comes out only 9 chars long.

char * value = XMLString::transcode( pNode->getNodeValue() );
cout<<"original length is "<<strlen( value )<<endl;
cout<<"Its a text named
"<<XMLString::transcode(pNode->getNodeName())
<<" value "
<<XMLString::transcode(pNode->getNodeValue())
<<" size is "<<XMLString::stringLen( pNode->getNodeValue())
<<endl;

I get back...

original length is 9
Its a text named #text value ja_alert- size is 15

(notice the Japanese is gone).
My locale looks like...
=> locale
LANG=ja
LC_CTYPE="ja"
LC_NUMERIC="ja"
LC_TIME="ja"
LC_COLLATE="ja"
LC_MONETARY="ja"
LC_MESSAGES="ja"
LC_ALL=
Do I need to something to tell the transcoder what encoding to transcode
to??

-Robert


Jul 20 '05 #2
On Mon, 18 Apr 2005, Robert M. Gary wrote:
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180

<Name>ja_alert-\343\201\250\343\201\241\343\201\244\343\201\252\3 43\201\256\343\
201\253</Name>
(I'm not sure if the Japanese came out right here, but everything after
ja_alert- is UTF-8 for Japanese).


If you continue to use this newsreader surrogate instead of an
actual newsreader, you need to select

Tools > Options > Send
Mail Sending Format > Plain Text Settings > Message format MIME
News Sending Format > Plain Text Settings > Message format MIME
Encode text using: None

in order to transmit special, non-ASCII characters.

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Thomas | last post by:
Hi there, a while ago, I posted a question regarding reading japanese text from a text file. Well, since I solved the problem, I thought I'd post my solution for the benefit of other people with...
3
by: Keitaro | last post by:
Hi, I am developing a vocabulary trainer. The languages I want to support are German and Japanese. When I try to store Japanese characters in my mysql database, I do not get the correct...
1
by: Sven Hanefeld | last post by:
Hi, who is able to help. I want to translate my whole website into japanese language. www.nord-com.net/hanefeld What do I have to do except finding a japanese guy for the translation. Do I...
3
by: Benoit Martin | last post by:
in my windows app, I have some japanese text that I load from a text file and display on a label. No matter what type of encoding I try to use on the text file, the text always comes up as a bunch...
0
by: eagle_speaks | last post by:
I am posting this for reference so that some may find it usefull --------------------------------------- XML transcode - XMLCh to char void CADCXMLEventHandler::startElement( const XMLCh*...
1
by: jim figurski | last post by:
Hi, I have an American computer using windows XP. I recently bought a japanese game to help me learn japanese as I play. I installed the game sucessfully, but the letters are not displayed in...
21
by: Doug Lerner | last post by:
I'm working on a client/server app that seems to work fine in OS Firefox and Windows IE and Firefox. However, in OS X Safari, although the UI/communications themselves work fine, if the...
12
by: paulgor | last post by:
Hi, May be it's a know issue but my search brought nothing... We have static HTML files with Japanese text in UTF-8 encoding - it's on-line Help for our application, so there are no Web...
1
by: tony.pahl | last post by:
We are converting a data warehouse to a Unicode database to get ready for multilingual support. If we will have 95% of our data in English as we currently do, and less than 5% in other foreign...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.