Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# function returning unicode fonts - chinese 2

Status
Not open for further replies.

smsaji

Programmer
Jun 26, 2005
91
CA
Hi All,

Have stored sample data in English, French and Chinese in xml Reading it through a c#.net function.
loading as follows:

public string getContent( string langcode)
{
XmlDocument doc = new XmlDocument();
XmlNode EntryNode;
doc.Load(@"C:\dataDict.xml");
EntryNode = doc.SelectSingleNode("/multilingual/language");
string test = EntryNode.InnerText;
return (test);
}

XML file as follows:

<multilinugal>
<language> ?? </language>
</multilingual>

Accessing the function in crystal report 10.

if the text in xml is English or French like:
<multilinugal>
<language> helo</language>
</multilingual>

then data is displayed in the crystal report.

If it is Chinese or Japanese data, it is displayed as ????? in crystal report. Tried to change the conditional font for that field in CR10 using "NSimSun". But still it displays ????.

Thr problem may be, I am storing and retuning the chinese font in a string data type. I read char supports unicode. I tried to change code as follows:

char[] cc;
val="??";
cc=val.ToCharArray();
return(cc)

and made function to return char[].

the result does not show up. Stuck up.

Any clues, appreciated! returning unicode fonts from a function.

(this one posted in xml and crystal report forums as well). But I think it's something wrong with c# data type I'm using.

thanks
saj
 
What you may be seeing happen is a font issue. Make sure the selected font can display the CJK characters you're using. If you're not sure, write the results out to a .txt file temporarily, and use a Unicode-aware editor (Notepad or Unipad) to view it.

Another possibility is that of Crystal not supporting non-western glyphs. I'm not an expert on C-R, so I don't know -- maybe someone else knows.

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
Thank you, chiph.

By the meantime, tested with debugger. and the line

EntryNode = doc.SelectSingleNode("/multilingual/language");

is showing undefined value, but if it is english it picks up the value.

So installing MSDN. if anyone knows pls share it.
 
Thanks Jurk (not using rest of the word)!

the encoding in xml file utf-8.

I'm sorry about the previous debug message.
In debugging mode the

retrun(test), test carries the real value for instance russian, ??????.
This function is registered as COM. so any idea how it should be treated. The chinese or russian fonts display in crystal when accessed from functions created in crystal but not so when accessed as COM object.
 
Yes chiph, the CJK characters from the functions are displayed in the text editor. The crystal report also displays CJK characters internally.

The .net function is registered as COM interop and is then available to crystal report. So it look it is lost somewhere in COM. Now, I am reading on marshaling in COM.

thanks
saj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top