How to find an extended ASCII character
Hi,
I have a problem while reading from a InputStream with a BufferedReader. I�m trying to find out if an extended ASCII character is within a String made with readline(), but it always says no. Example:
myString.indexOf('\u00D2')
While debugging, I see that the character is a '?'.
How can I find this extended ASCII character ('\u00D2') ? Is it an encoding matter?
Please help!!
You are using a default character encoding when you use BufferedReader, so the text you read is probably translated to some other character in some cases (two or more bytes can sometime make up a new unicode character depending on the encoding).
You could try this:
BufferedReader br = new BufferedReader(new InputStreamReader(in, "IS0-8859-1"));where in is your InputStream.
Similar Messages
-
How do I convert the ASCII character % ,which is 25h, to a hex number 25h. I've tried using the scan value VI but I get a zero in the value field.
You can use String to Byte Array for this.
-
Need to find out extended ASCII characters in database
Hi All,
I am looking for a query that can fetch list of all tables and columns where there is a extended ASCII character (from 128 to 256). Can any one help me?
Regards
Yadalayadala wrote:
Hi All,
I am looking for a query that can fetch list of all tables and columns where there is a extended ASCII character (from 128 to 256). Can any one help me?
Regards
YadalaThis should match your requirement:
select t.TABLE_NAME, t.COLUMN_NAME from ALL_TAB_COLUMNS t
where length(asciistr(t.TABLE_NAME))!=length(t.TABLE_NAME)
or length(asciistr(t.COLUMN_NAME))!=length(t.COLUMN_NAME);The ASCIISTR function returns an ASCII version of the string in the database character set.
Non-ASCII characters are converted to the form \xxxx, where xxxx represents a UTF-16 code unit.
The CHR function is the opposite of the ASCII function. It returns the character based on the NUMBER code.
ASCII code 174
SQL> select CHR(174) from dual;
CHR(174)
Ž
SQL> select ASCII(CHR(174)) from dual;
ASCII(CHR(174))
174
SQL> select ASCIISTR(CHR(174)) from dual;
ASCIISTR(CHR(174))
\017DASCII code 74
SQL> select CHR(74) from dual;
CHR(74)
J
SQL> select ASCII(CHR(74)) from dual;
ASCII(CHR(74))
74
SQL> select ASCIISTR(CHR(74)) from dual;
ASCIISTR(CHR(74))
J -
How to find out the ASCII Values for Spanish character
Hi,
I had an requirement to store Spanish character and also need to fileter the records based on the Spanish character.
Kindly guide me for below.
To filter the Records which contains spanish characters?
To get the ASCII Values for the particular column?
E.g. we can find out the ASCII value of 'a' by using the syntax select ASCII('a') from dual.
But I want to find the ASCII Values for the particular column value. Ie. name.
E.g., Client name is "Suresh", I want to the ASCII Values for entire name of "Suresh".
Kindly do the needful help / Guidance on this.
Thanks,
OraharTo expand on what I said in my first post, you want to do something along these lines:
with t (thename) as
select 'Suresh' from dual
select thename
, substr(TheName, level, 1)
, ascii(substr(thename, level))
from t
connect by level <= length(thename);The output of the above query is:
THENAM S ASCII(SUBSTR(THENAME,LEVEL))
Suresh S 83
Suresh u 117
Suresh r 114
Suresh e 101
Suresh s 115
Suresh h 104
6 rows selected.Note that the WITH statement is only there to simulate a table for this example. With a table, all you do is get rid of the with and substitute the name "t" for the name of your table (also the name of the column to whatever name the column has in your table).
Lastly, I suggest you post your question along with, an example table and the output you'd like to get in the PL/SQL forum. There are people there that will give you all kinds of great ways of solving that problem.
HTH,
John. -
How do I convert an ASCII character to an array of co-ordinates.
I need to convert and ASCII character to an array of X, Y co-ordinates. I also need to be-able to vary the size of the text (scale of graph i suppose) and position on the graph So i can desplay multiple characters on a graph. However it needs to be stored in an array (or set of arrays) so i can isue these co-ordinates to an instrument.
Maybe the attached VI can help. Using picture control functions, it get the
1bit bitmap of the character/text
on input in a 2D array of booleans.
Jean-Pierre Drolet
"m0mbaj0mba" a écrit dans le message news:
[email protected]..
> I am trying to find a simple way to convert a letter (ASCII character)
> into an array of X,Y co-ordinates. I am involved in two projects that
> involve spelling letters with lasers. At the moment we are plotting
> the points on a graph in excel, transferring the co-ordinates into a
> text file and then converting the content of these text files into a
> set on 1D arrays. As I am sure you can appreciate this is a very long
> winded process. Is there anyway of pl
otting points on an X,Y, graph
> and outputting those points to an array or set of arrays?
>
> Excel spreadshett is attached.
[Attachment GetTextBitmap.vi, see below]
LabVIEW, C'est LabVIEW
Attachments:
GetTextBitmap.vi 45 KB -
How to find out the repeated character in a string value?
Dear People,
I want to trace out the names where a character occured more than once.for ex, i need o/p as
ENAME
ALLEN
TURNER
ADAMS
In which all the above name consists of repeated characters.
I use Oracle 10g and i tried using REGEXP say for ex,
SELECT ENAME FROM EMP WHERE REGEXP_LIKE(ENAME,'L{2}');
ENAME
ALLEN
MILLERbut this works only for single character.how to specify condition for any character?.pls suggest me.
With Regards
VIDSHere is one way you can use from version 10 upwards:
SQL> with emp as
2 ( select 7369 empno, 'SMITH' ename, 'CLERK' job, 7902 mgr, date '1980-12-17' hiredate, 800 sal, NULL comm, 20 deptno from dual union all
3 select 7499, 'ALLEN', 'SALESMAN', 7698, date '1981-02-20', 1600, 300, 30 from dual union all
4 select 7521, 'WARD', 'SALESMAN', 7698, date '1981-02-22', 1250, 500, 30 from dual union all
5 select 7566, 'JONES', 'MANAGER', 7839, date '1981-04-02', 2975, NULL, 20 from dual union all
6 select 7654, 'MARTIN', 'SALESMAN', 7698, date '1981-09-28', 1250, 1400, 30 from dual union all
7 select 7698, 'BLAKE', 'MANAGER', 7839, date '1981-05-01', 2850, NULL, 30 from dual union all
8 select 7782, 'CLARK', 'MANAGER', 7839, date '1981-06-09', 2450, NULL, 10 from dual union all
9 select 7788, 'SCOTT', 'ANALYST', 7566, date '1982-12-09', 3000, NULL, 20 from dual union all
10 select 7839, 'KING', 'PRESIDENT', NULL, date '1981-11-17', 5000, NULL, 10 from dual union all
11 select 7844, 'TURNER', 'SALESMAN', 7698, date '1981-09-08', 1500, 0, 30 from dual union all
12 select 7876, 'ADAMS', 'CLERK', 7788, date '1983-01-12', 1100, NULL, 20 from dual union all
13 select 7900, 'JAMES', 'CLERK', 7698, date '1981-12-03', 950, NULL, 30 from dual union all
14 select 7902, 'FORD', 'ANALYST', 7566, date '1981-12-03', 3000, NULL, 20 from dual union all
15 select 7934, 'MILLER', 'CLERK', 7782, date '1982-01-23', 1300, NULL, 10 from dual
16 )
17 select ename
18 , e
19 , count(*)
20 from ( select ename
21 , e
22 from emp
23 model
24 return updated rows
25 partition by (ename)
26 dimension by (0 i)
27 measures (ename e)
28 ( e[for i from 1 to length(e[0]) increment 1] = substr(e[0],cv(i),1)
29 )
30 )
31 group by ename
32 , e
33 having count(*) > 1
34 /
ENAME E COUNT(*)
SCOTT T 2
MILLER L 2
ADAMS A 2
ALLEN L 2
TURNER R 2
5 rows selected.Regards,
Rob. -
Extended ascii character problem
Here is the message I am getting
2004-10-12 10:04:44,207 ERROR [STDERR] org.postgresql.util.PSQLException: Invalid character data was found. This is most likely caused by stored data containing characters that are invalid for the character set the database was created in. The most common example of this is storing 8bit data in a SQL_ASCII database.
this is the character that is causing the problem (ascii 0232 �)
My question is how can I make java display this character. I am using Postgresql 7.4 as my database.I don't understand the connection between the database and "java display".
And ASCII is a 7 bit character set, so the character you listed is not ASCII, rather it is a character in some other character set. -
Extended ASCII character problems
We are having problems with certain characters. If a character in the range ASCII 194-239 appears in a string it can cause the next character to be lost. Everything seems okay in SQL, but not in PL/SQL.
A PL/SQL script to print all the ASCII characters outputs nothing for the above range.
e.g.
DECLARE
v VARCHAR2(100):= 'Requiem por un PolicÃ|xxx|qqq';
BEGIN
dbms_output.put_line(instr(v,'|'));
dbms_output.put_line(substr(v,instr(v,'|')));
END;
The expected results would be 22 and |xxx|qqq, but we actually get 25 and |qqq. The first '|' is being lost somehow.
A test using a Java function retrieving the string from a table failed due to a conversion failure between UTF8 and UCS2.
The NLS language is AMERICAN and the character set is UTF8.
Thanks
SteveI know this thread is old, but it took me forever to find this out...
Use:
SELECT CHR (<ASCII Value> USING NCHAR_CS) FROM DUAL;
E.g.
SELECT CHR (206 USING NCHAR_CS) FROM DUAL;
CHR (206 USING NCHAR_CS)
ÎEdited by: martinByrne on 04-Aug-2010 08:37 -
How can i convert an ascii character to a number?
where can I find the function?
A string will be converted to an array of U8.
Unless you convert a single character.
RayR
Message Edited by JoeLabView on 06-27-2008 05:39 PM
Attachments:
Str2Num.vi 7 KB
String2Number.PNG 7 KB -
How to find length of a character variable in sap script
Hi,
I have stored a line of text in one variable. If the text exceeds more than 50 characters, the remaining characters will be printed in next line.
For this i have given code as :
<I>&S_BOL_SUMMARY-TXT(50)&</>
<I>&S_BOL_SUMMARY-TXT+50&</>
The problem is i have to print the second line only when the text exceeds more than 50 characters. So how can i give the condition for that?
EzhilHi,
Try the following,
data: len type i.
len = strlen (S_BOL_SUMMARY-TXT ).
if len > 50.
&S_BOL_SUMMARY-TXT(50)&
&S_BOL_SUMMARY-TXT+50&
else.
&S_BOL_SUMMARY-TXT(50)&
endif. -
Hi
I am getting data from postgreSQL using java. When i was trying to convert from C++ through jni it is giving data incorrectly. Some French characters are not dispalying properly.849799 wrote:
I am getting data from postgreSQL using java.So, you are using the postgreSQL JDBC interface?
When i was trying to convert from C++ through jni it is giving data incorrectly.
Some French characters are not displaying properly.There is not enough information to say what is wrong.
Is Java or C++ retrieving data from postgreSQL?
Is Java or C++ displaying data?
Is the data UNICODE at all times? [Probably not]
What other encoding is used?
Do you have logging of bytes and chars where relevant? -
How to query for extended ASCII characters in column value
Hi All
Sorry if this has been answered before. I tried searching but none of them seems to work for me.
I am trying to search for inverted ? in my column.
I am using the following query
select *
from table_name
where regexp_like (description , '¿' )Did you try:
like '%¿%'
create table table_name (description varchar2(100))
insert into table_name values ('jh¿¿gagd')
insert into table_name values ('jhga345gd')
insert into table_name values ('j1231232hgagd¿')
select *
from table_name
where regexp_like (description , '¿' )
DESCRIPTION
jh¿¿gagd
j1231232hgagd¿
select * from table_name
where description like '%¿%'
DESCRIPTION
jh¿¿gagd
j1231232hgagd¿Edited by: user130038 on Sep 8, 2011 12:29 PM -
How to write extended ASCII characters to a file
Here is a distilled fragment from some larger script. Its purpose is to create a text file containing some characters from the extended ASCII character set.
$String = "Test" + [char]190 + [char]191 + [char]192
echo $String | out-file d:\test.txt -Encoding ascii
What I want in the target file is exactly the 7 characters that make up $String. The above method fails to deliver this result. How can I do it?Hi,
Try using Add-Content or Set-Content instead:
$String = "Test" + [char]190 + [char]191 + [char]192
echo $String | Set-Content .\test.txt
Don't retire TechNet! -
(Don't give up yet - 13,225+ strong and growing) -
SQL Developer, UTF8 Oracle DB, extended ascii characters appear as blocks
I have this value stored on the database:
(Gestion Económica o Facturaci
Notice the second word has an extended ascii character in it. When I use SQL Developer on my windows machine to view the data, I get a box in place of the o, kinda like this:
(Gestion Econ�mica o Facturaci
If I log on to the AIX server where the oracle database in question is and run sqlplus from there, I see things properly. I also managed to regedit oracle home to get sql plus on my windows machine to display this properly. I still cannot get sql developer to work though...
Details about sql developer:
font: arial Unicode MS
environment encoding: UTF-8
NLS Lang: American
NLS Territory: America
windows regional options:
English (United States)
Location: United States
Database NLS settings:
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT mm/dd/yyyy hh24:mi:ss
NLS_DATE_LANGUAGE AMERICAN
NLS_CHARACTERSET UTF8
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
Any ideas on how I can fix this. I'd rather NOT log onto the server to run queries.... thanks in advance for your thoughts!
Edited by: user10939448 on Jan 31, 2012 1:51 PMuser10939448 wrote:
This problem is quite strange in that when I've been able to manually set American_america.utf8, things work.Sorry to say, but it seems you may have an incorrect setup.
In general, you should set char set part of NLS_LANG to let Oracle know the code page used by the client. With win-1252, NLS_LANG should include .WE8MSWIN1252.
The display from sqlplus was "lying", due to incorrectly stored data coupled by incorrect nls_lang setting (char set part). The pass-through or gigo scenario can be dangerous this way. Search the Globalization forum for the term 'pass-through' for previous discussions on the theme.
The setting on AIX servers may be incorrect as well, but it depends how you use it (e.g. for database export or data load with utf-8 encoded files it may be correct).
The output of the query you recommended looks odd to me:
(Gestion Econ�mica o Facturaci Typ=1 Len=30 CharacterSet=UTF8:
28,47,65,73,74,69,6f,6e,20,45,63,6f,6e,f3,6d,69,63,61,20,6f,20,46,61,63,74,75,72,61,63,69;This is the telling part. The 0xF3 is not legal in UTF8. Actually, the code units for ó, U+00F3 Latin small letter o with acute, are C3 B3. So instead of f3 you should have expected c3,b3 from the dump output.
>
So it looks like what's under the covers is correct, but I'm still not seeing the correct character in sql developer.The opposite is true. Data is incorrectly stored and SQL Developer is correctly showing you this. Sqlplus is not the best tool in Unicode environments, SQL Developer is better.
>
ACP according to my windows registry is 1252. OEMCP is 437Also, if you use database clients in console mode (such as sqlplus), NLS_LANG should include .US8PC437 to properly indicate that code page in use is 437. -
Printing extended ascii characters
How can i print an extended ascii character through a java program if i know its ascii value?I tried this :
for (int i=0;i<256;i++)
System.out.print((char)i);
and i got the character '?' printed on the console for some of the characters.How can i print an extended ascii character through a
java program if i know its ascii value?I tried this
for (int i=0;i<256;i++)
System.out.print((char)i);
and i got the character '?' printed on the console
for some of the characters.According to this site: http://www.pantz.org/html/symbols-hex/htmlcodes.shtml
[[[HTML 4.01, ISO 10646, ISO 8879, Latin extended A and B]]]
The ASCII value 8240 == �
According to this site: http://www.idevelopment.info/data/Programming/ascii_table/PROGRAMMING_ascii_table.shtml
[[[ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1]]]
The ASCII value of 137 == �
It seems like it's a Windows ISO 8859-1 issue.
From everything I've read it appears as though there are no characters from DEC value of 128-159 inclusive. DEC value 127 is DEL delete and DEC value 160 is � in the Latin-1 encoding or ISO-8859-1.
I have a program that writes ASCII values to the screen. If I try to force it to print a value in the 150's it fails, returning the symbol --->>> ?
However it can print every other ASCII value that I've tired (in the output file, the � symbol prints correctly but when it's posted on the forum it doesn't show up...). Here's an input sample:
�
�
�
�
�
�
�
�
�
�
�
�
Output:
[�] [40] [1] [402]
[�] [41] [1] [381]
[�] [42] [1] [8364]
[�] [43] [1] [171]
[�] [44] [1] [182]
[�] [45] [1] [174]
[�] [47] [1] [8240]
[�] [49] [1] [255]
[�] [50] [1] [214]
[�] [51] [1] [220]
[�] [52] [1] [162]
[�] [53] [1] [163]
Trying to force (char)155
out.write( (char)155 + lineSep );
Prints: ?
Maybe you are looking for
-
Which rpm packages do I need to get a hold of?
We're trying to set up a temporary test server for a customer, and they asked for the following packages to be installed: compat-libstdc++-egcs-1.1.2-1.i386.rpm compat-oracle-el5-1.0-5.i386.rpm (among others which installed fine) When I attempt to in
-
Why can't I use the Edit with Illustrator or Edit with Photoshop features in FrameMaker12?
Why can't I use these features any more? I also can't use the Launch Photoshop or Launch Illustrator features. I use the Adobe Master Collection 6 for those products. Adobe Captivate is also grayed out.
-
How to add email accounts on Ipad 2
I can't add email accounts on my Ipad 2. When I select Settings, Email-Contacts-calendar the Ipad returns to the begin screen. I don not get any possibility to select an email provider or add an account. Just the begin screen. Thanks, Ferdy
-
Hi, I'm new to Swing and am looking for a good book and/or white paper on the correct way to structure a swing application in JDK 1.6. There are a lot of ways to do things but I'm looking for suggestions for the simple stuff: best way to start up and
-
Creating directory under specific schema
What is the syntax to create a directory under a specific schema? Here is what I've tried and I get an error: CREATE OR REPLACE DIRECTORY test.utl_dir AS 'D:/utl_dir' ; Here is the error: Error starting at line 1 in command: CREATE OR REPLACE DIRECTO