Chinese chars to hex?
how can I convert chinese characters to hexadecimal format when I read those char from a file?
It's not too clear what you mean by converting to hexadecimal but I guess this is what you want:char c = someChineseCharacter;
String inHex = Integer.toHexString(c);
Similar Messages
-
how can i get the chinese character hex format from sql
select upper(lpad(ltrim(to_char(ascii(unistr ('<your letter here> ')),'xxxx')),4,'0')) hex from dual;
scott@ORCL> select upper(lpad(ltrim(to_char(ascii(unistr ('a')),'xxxx')),4,'0')) hex_format from dual;
HEX_
0061 -
Traditional Chinese formed in Hex code??
Hi,
I want to know how to convert a traditional chinese into a hex value...
thx...you may try this:
char c;
// where c is a chinese char
string HexofC:
// HexofC is the Hex value string of c
HexofC = Integer.toHexString(xi).toUpperCase(); -
Can Not Display Normal Chinese Chars in JSP
Hi,
I am displaying some chinese chars in a normal JSP file but it show me some
funny things. If I get the data from the oracle and the information is chinese,
then it display correctly. And I try another thing that I save the noraml JSP
(without any java code) to a html and it is working fine. Same content, if saved
as HTML, then ok. If saved as JSP, then got problem. I am using weblogic 6.1.
There are somewhere need to be configure or... Any idea for this? Thank you
very much!
yang linHi Howard,
if i use Font.createFont() to general font object that
can solve chinese display problem in RH 7.3. but i
thought, it's no reasonable way to use font object.
that is really bad for cross-platform benefit or you
need to carry font file with your application.
have a way to set default font use createFont()
object?In the past, I've carried the font file around with me. Given the number of graphics files, properties files and
other assorted garbage that apps are already carrying around, it's not too unreasonable to have to add a
TrueType font to the list of hangers-on (unless it's the size of Arial Unicode MS - 23Mb is a big ask sometimes)!
Given that TrueType fonts themselves are essentially platform-independent, I don't see it as too much of an issue. But that's just me and my experiences! ;-)
To set the font as default...
try {
FileInputStream fis = new FileInputStream("myFont.ttf");
Font defaultFont = Font.createFont(Font.TRUETYPE_FONT, fis);
setFont(defaultFont);
} catch (FontFormatException ffe) {
System.err.println("My TrueType font is corrupted.");
} catch (IOException ioe) {
System.err.println("My I/O stuffed up.");
}There are various ways to set the font in even better ways, particularly if you're in a standalone app, but the above is at least a good basic one.
Hope that helps,
Martin Hughes -
Chinese char. in PDF file
Hi,
Chinese char. in PDF no problem to printer, but when spool to file, chinese char. is "###"
What to be set in order to solve this issue.
Thank you.
Best Regards
SheseHi,
thanks for your repply.
Yes, we are in ECC6.0.
I think it's a unicode problem, but I don't know how to fix it.
Mich -
Web.show_document cannot display file with Chinese char in IIS 6
Dear all,
There is a problem that web.show_document cannot display file with Chinese char in IIS 6, but works fine in IIS 5.
Is it a server problem or is there any setting in server? Do you know how to solve it?
Big Thanks
JYHi,
As Francois mentioned, this issue has nothing to do with forms / web.show_document. web.show_document, just opens the URL specified as parameter. So, if you run the URL (that you've passed as argument for web.show_document), directly in the browser, you would be getting the same issue.
So, as you said, if it works fine in IIS 5 and does not in IIS 6, it would be an issue with the IIS and not forms. You might want to check out the IIS 6 release notes / documentation for any known issues / raise an issue in that.
-Arun -
Chinese char issue in smartform preview as pdf format
Hi chinese guy!!
please help me with chinese char in smartform preview as pdf format
i created smartform with chinese char and then when executing this smartform by t-code smartforms, it show as simplified chinese char, but when getting JOB_OUTPUT_INFO in order to convert OTF as pdf format, although smartforms performed as pdf format, only chinese char were broken. smartform with english or korean language does not have any issue, only chinese issue now.
i got into r/3 as logon ZH by SAP GUI english version and i used adobe acrobat reader chinese simplifed version. r/3 version is ecc60 unicode system***
please help me,, any chinese guy there?
1. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
2. CONTORL_PARAMETERS-NO_DIALOG = 'X'.
CONTORL_PARAMETERS-GETOTF = 'X'.
OUTPUT_OPTIONS-TDNOPREV = 'X'.
CLEAR JOB_OUTPUT_INFO.
3.
CALL FUNCTION FUNCTION
EXPORTING
CONTROL_PARAMETERS = CONTORL_PARAMETERS
OUTPUT_OPTIONS = OUTPUT_OPTIONS
IMPORTING
JOB_OUTPUT_INFO = JOB_OUTPUT_INFO
TABLES
ITEM = ITEM
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4.
OTF_TAB[] = JOB_OUTPUT_INFO-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
IMPORTING
BIN_FILESIZE = PDF_FSIZE
TABLES
OTF = OTF_TAB
LINES = PDF_TABLE
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.hi,
please see the notes 999712.
thanks -
Zip.ZipInputStream cannot extract files with Chinese chars in name
Dear friends,
Peace b upon u!
I am trying to read a zip file (~3000 files)containing one
or more files with Chinese, Japanese or Korean names, the
getNextEntry method throws an IllegalArgumentException as below after extracting just ~300 files as below:-
java.lang.IllegalArgumentException
at java.util.zip.ZipInputStream.getUTF8String(Unknown Source)
at java.util.zip.ZipInputStream.readLOC(Unknown Source)
at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
at testZipFiles.getZipFiles(testZipFiles.java:65)
at testZipFiles.main(testZipFiles.java:18) issue:java.util.zip.ZipInputStream cannot extract files with Chinese chars in name
Category java:classes_util_jarzip
Plz let me know 1 of the ways which I can solve this issue.
1)if someone has JAVA DCOMPILER plz send the SOURCE Code
for the ZipInputStream.class to me..I need to edit it using 1 of the solutions as provided below which I googled.
2)If there is an alternate or upgraded java.util.zip.ZipInputStream or any org.apache.tools.zip.* package which can read such files..If yes where I can download the same on net.
3)Any other easier solution, which can let me extract all files (by excluding Chinese files thru CATCH) without the extractor process to fail altogether.
On net I found that the only solution with this is:-
- edit the new ZipEntry, remove the static initializer that calls
the native methods initIDs().
this step seems a bit scary, but it's according to the
workaround
to bug #4244499 (the workaround of Olive64, THU JUN 05
01:55 P.M. 2003),
that handles a similar bug at the ZipOutputStream.
Now you have a ZipInputStream that supports multi-bytes
entry names.
to extract the zip file, using the fixed code that is offered
above,
create a function that gets an "encoding" string, a "destPath"
string
and a "sourceFile" (zipped) and does :
ZipInputStream zipinputstream = null;
ZipEntry zipentry;
zipinputstream = new ZipInputStream(new FileInputStream
(sourceFile),encoding);
zipentry = zipinputstream.getNextEntry();
while (zipentry != null) { //for each entry to be extracted
String entryName = zipentry.getName();
int n;
FileOutputStream fileoutputstream = new FileOutputStream
( destPath + entryName );
while ((n = zipinputstream.read(buf, 0, 1024)) > -1)
fileoutputstream.write(buf, 0, n);
fileoutputstream.close();
zipinputstream.closeEntry();
zipentry = zipinputstream.getNextEntry();
}//while
zipinputstream.close();Hi friend,
We'd better to ask one question in each thread. If you have another issue, you can consider to open up a new thread in this forum.
Now for the first question, do you mean this picture? It throws access exception in archive2.
If so , because your extractPath is a path, not a directory.You should add +"xxx.zip". For more information, please refer to
ZipFile.Open
Method (String, ZipArchiveMode).
For the second question, you can use the following code to skip the error message.
while (true)
try
//do something;
catch (Exception ex)
{ continue; }
Good day!
Kristin
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. -
How to show chinese char form db in my jsp portlet?
How to show chinese char form db in my jsp portlet?
I had tried to set contentType in renderResponse, but itn't work ..Bent,
You can access the database from your Java portlet, just like from any other Java/JSP environment. Yes, you can use JDBC, as well as BC4J.
The Discussion Forum portlet was built using BC4J, take a look at it's source to see how it was done.
Also, check out Re: BC4J Java portlet anyone?, it contains a lot of useful information too.
Peter -
Problem with zipping file with chinese chars
I need to zip a html page which contains some chinese characters, I am able to zip it and create a zip file
but the problem is when i open the zip file and view the html file it displays junk characters instead
of chinese characters
Here is what i am doing
ByteArrayOutputStream bStream = new ByteArrayOutputStream();
ZipOutputStream zStream = new ZipOutputStream(bStream);
ZipEntry zipEntry = new ZipEntry(htmlFilename);
zStream.putNextEntry(zipEntry);
ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter(
new OutputStreamWriter(dataStream,"UTF-8"));
writer.write(htmlString); //htmlString is the string which contents the html contents which has chinese char
writer.close();
zStream.write(dataStream..toByteArray());And when you view the unzipped file, are you using something that realizes that you encoded your data using UTF-8? My guess is that you are not.
PC² -
Chinese Char support in JNLP file
Hi All,
We have to support the chinese char in jnlp file as jar file name.
Can we support this .
Kindly provide this information we anybody new about this ...
Thanks in advance for your support.
Regards,
Piyush>
Thats setting the system properties right? >Not so much (AFAIR you can 'set' java.home, but it has no effect). It is simply properties that are accessible to the app. at run-time.
>
I wanted to send command line argument, wher in main(String[] arg) method I wanted to access from the arg[] arrays,
Is there any way to do that? Then what is the purpose of <argument> tag?>That is doable as well. I have seen two common forms of handing arguments with names..
java theapp.jar -foo fooValue -bar barValue
java theapp.jar foo=fooValue bar=barValueThe first presumes all names and values occur in order (1 name, 1 value, 1 name, 1 value..) and arrive at main(String[]) in that order. The second has the '=' sign as delimiter between name and value.
The way they would be specified as arguments is something like..
<application-desc ..>
<argument>-foo</argument>
<argument>fooValue</argument>
<argument>-bar</argument>
<argument>barValue</argument>
</application-desc>&
<application-desc ..>
<argument>foo=fooValue</argument>
<argument>bar=barValue</argument>
</application-desc> -
Unicode, assignment char to hex
Hi Experts,
I have a question related to assignment of char to hex in
uni-code system.
Here is piece of code:
In non-uncode system:
data:
begin of struct,
x1(1) type x,
end of struct.
data:
c1 type c value 'C'.
struct1 = c1.
In unicode system
*struct1 = c1 is not allowed.
If i assign struct1-x1 = c1, intenally the values value are getting changed that can be seen in debug mode .
for example: internal value for 'C' is 43,similarlly for 'L' it is 4C.
so how can i assign this in unicode system with out the values to be changed ...
please reply
Sorry iam posting this twice because the first post thread got closed .....
Regards
Syed Abdul Adil.There are function modules in the system to convert hex values to char values.
These function modules are:
NLS_STRING_CONVERT_TO_SYS (hex to char)
NLS_SRING_CONVERT_FROM_SYS (char to hex)
If it's the tab character then it can be done with (example):
data: x1 type char1 value c1_abap_char_utilities=>horizontal_tab. -
Hi Experts,
I have a requirement to convert char type to Hex type.
I have two structures. one is Character type and other is hex type like below.
data: v_hex(300) type h,
v_char(300) type c.
When we move v_char(300) to v_char(300), it is working fine in 4.6 system.
But it is giving unicode error in ECC 6.0. So i have changed the statement to v_hex = v_char.
There is no syntax error but it is not converting the same.
Please post your replies. Thanks in advance.REPORT ZSRK_039 .
DATA: V_HEX(300) TYPE X,
V_CHAR(300) TYPE C.
V_CHAR = 'Test'.
PERFORM CHAR_TO_HEX_CONV USING V_CHAR
CHANGING V_HEX.
WRITE : / V_HEX.
*& Form CHAR_TO_HEX_CONV
text
-->P_V_CHAR text
<--P_V_HEX text
FORM CHAR_TO_HEX_CONV USING CH TYPE C
CHANGING CH1 TYPE X.
FIELD-SYMBOLS : <FS_TR> TYPE X.
ASSIGN CH TO <FS_TR> CASTING TYPE X .
CH1 = <FS_TR>.
ENDFORM. " CHAR_TO_HEX_CONV -
Hi Experts ,
i am working in Upgradation project. In one of the program i came across Moving Char value to Hexa value. More over , the char( CHAR(1) ) value is passing dynamically to Hex.
Is there any function module to solve this issue. i got CHAR_HEX_CONVERSION but it is not working.
Thank you.
Regards,
Kiran.Hello,
Does the method CONVERT of class CL_ABAP_CONV_IN_CE help ?
A few links which might interest you :
[Conversion xstring to string|Conversion xstring to string]
[http://help.sap.com/saphelp_nw70/helpdata/en/ba/78d3c747b24546ab1c1499a054d8a5/content.htm|http://help.sap.com/saphelp_nw70/helpdata/en/ba/78d3c747b24546ab1c1499a054d8a5/content.htm]
BR,
Suhas
Edited by: Suhas Saha on Jan 21, 2010 5:41 PM -
Can't display *proper* Chinese char in v3.0.04 connecting to MySQL
Hello to all guru,
I am having some trouble on displaying Chinese characters on SQLDeveloper connecting MySQL database...
Database: MySQL 5.5.17, for Win32 (x86)
SQLDeveloper: 3.0.04
JDBC: Connector/J 5.1.18 from MySQL
Connection has no problem, retrieving data also great.
Using mysql.exe at Windows Command Prompt, it could display the proper Chinese characters perfectly...
mysql> SHOW VARIABLES LIKE 'character_set_system';
-----------------------------+
| Variable_name | Value |
-----------------------------+
| character_set_system | utf8 |
-----------------------------+
1 row in set (0.09 sec)
mysql> select display_name, display_name_chi
-> from contact
-> where display_name = 'David Chan';
--------------------------------+
| display_name | display_name_chi |
--------------------------------+
| David Chan | 陳大衛 |
--------------------------------+
1 row in set (0.00 sec)
Run the same select query on SQLDeveloper, it shows...
display_name display_name_chi
David Chan ³¯¤j½Ã
On SQLDeveloper, Tools > Preferences > Database > NLS, there seems to have some NLS settings to play with, and default settings are:
Language: AMERICAN
Territory: AMERICA
Tried changing to the followings...
Language: TRADITIONAL CHINESE
Territory: TAIWAN
Still displaying the monster characters... I haven't tested to see if SQLDeveloper would behave the same while connecting to Oracle Database, and I am thinking maybe just the Java GUI's issue?!
Can anyone give me some idea?Hi,
Here is a post that provides a solution for a similar Chinese language situation related to the Oracle JDBC driver:
Re: Can't select using special characters (symbols)
Perhaps you will be able to find something equivalent for the MySQL driver.
Regards,
Gary
SQL Developer Team
Maybe you are looking for
-
How to avoid Linkage Error in JAVA Mapping
Dear Experts, I am trying to test the JAVA mapping compiled in NWDS but receiving the error "LinkageError at JavaMapping.load(): Could not load class". java.lang.NoClassDefFoundError: JSONXMLProject/bin/com/sap/json/ConvJson2Xml (wrong name: com/sap/
-
Using iTunes 2.0.4 in OS 9
Due to iTunes 6's problems with burning CDs of 'continuous music' (ie there are audible clicks when one track runs in to the next), I've been rebooting into OS 9 to use iTunes 2.0.4 - which doesn't seem to have this problem - whenever I needed to bur
-
This might not be the correct forum but maybe someone out there knows how i can record video from my computer. I need good quality videos like you would see on www.lynda.com. Would anyone know how this can be done?
-
How to Convert Document to Form Result object.
We have orchestration in which we are generating PDF using render PDF Form and then to enable signature field we are using ReaderExtension:applyUsageRights which returns BLOB/Document type. Now We want to convert BLOB/Document type to FormResult Obje
-
Does JRE of a machine runs while accessing this machine Remotely? Any Idea? Why I m asking? I wanted to install JRE 1.4.2_14 and I have unsinstalled JRE 1.4.2_06 and JRE 1.4.2_06 on the same machine having windows 2000 proffessional. Still I have not