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.

Similar Messages

  • 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
    Steve

    I 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 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.

  • Non-ascii character problem

    hi
    Scenario: Reading Flat-File and writing into Oralce Table.
    In my database procedure, I have declared a column say X as VARCHAR2 to store string values. In the flat-file, some times the data for column X comes as Non-ASCII string values (e. SäHKOTOIM) and because of this the database procedure raises ORA-06502:PL/SQL:numeric or value error.
    So, how I can identify that the flat file has non-ascii values so that I can reject that record and move with another record?
    your suggestion will be greatly appreciated.
    Regards
    shakeel

    Hi,
    You set you nls_database_parameters which is compatiable with you input (non- ascii) characters.
    Try to use the LCSSCAN in order to know the relevant character set with respective to input and set the nls_parameters
    https://students.kiv.zcu.cz/doc/oracle/server.102/b14225/ch12scanner.htm#i1016925
    - Pavan Kumar N

  • Extended Ascii character

    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?

  • 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 PM

    user10939448 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.

  • 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
    Yadala

    yadala 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

  • 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: ?

  • 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)

  • Problem convertting certain extended ascii characters

    I'm having problems with the extended ascii characters in the range 128-159. I'm working with SQL server environment using java. I originally had problems with characters in the range 128-159 when I did a 'select char_col from my_table' I always get junk when I try to retreive it from the ResultSet using the code 'String str = rs.getString(1)'. For example char_col would have the ascii character (in hex) '0x83' but when I retrieved it from the database, my str equaled '0x192'. I'm aware there is a gap in the range 128-159 in ISO-8859-1 charset. I've tracked the problem to be a charset issue converting the extended ascii characters in ISO-8859-1 into java's unicode charset.
    I looked on the forum and it said to try to specify the charset when I retreived it from the resultset so I did 'String str = new String(rs.getBytes(), "ISO-8859-1")' and it was able to read the characters 128-159 correctly except for five characters (129, 141, 143, 144, 157). These characters always returned the character 63 or 0x3f. Does anyone who what's happening here? How come these characters didn't work? Is there a workaround this? I need to use only use java and its default charsets and I don't want to switch to the windows Cp1252 charset cuz I'm using the java code in a unix environment as well.
    thanks.
    -B

    Normally your JDBC driver should understand the charset used in the database, and it should use that charset to produce a correct value for the result of getString(). However it does sometimes happen that the database is created by programs in some other language that ignore the database's charset and do their own encoding, bypassing the database's facilities. It is often difficult to deal with that problem, because the custodians of those other programs don't have a problem, everything is consistent for them, and they will not allow you to "repair" the database.
    I don't mean to say that really is your problem, it is a possibility though. You are using an SQL Server JDBC driver, aren't you? Does its connection URL allow you to specify the charset? If so, try specifying that SQL-Latin1 thing and see if it works.

  • Contains query fails for extended ascii characters

    I have an Oracle 9.2 instance whose characterset is WE8MSWIN1252. I'm using the same characterset on my client. If I have a LONG column that contains extended-ascii characters (the example I'm using has the Euro character '€', but I've seen the same problem with other characters), and I'm using the Intermedia service to index that column, then this select statement returns no records even though it should find several:
    select id from table1 where (contains(long_col,'€',1) > 0);
    However, the same select statement looking for something else, like 'e', works just fine.
    What am I doing wrong? I can do a "like" query against a VARCHAR2 column with a Euro character, and it works correctly. I can do a "dbms_lob.instr" query against a CLOB column with a Euro character, and it also works. It's just the "contains" query against a LONG column that fails.

    There are a number of limitations in using Long datatypes. If you check the SQL Reference you will see: "Oracle Corporation strongly recommends that you convert LONG columns to LOB columns as soon as possible. Creation of new LONG columns is scheduled for desupport.
    LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases."

  • Extended ASCII changing to UNICODE in Oracle9i?

    Hello,
    We're just getting to verifying support for our applications against Oracle9i database. Historically, we've been supporting Oracle8 and Oracle8i, and they work just peachy.
    On some of our tables, we have a varchar column that is 255 characters long. We often import data that is exactly 255 chars in length. With 9i, if the data is 255 chars long, and contains any extended ASCII chars (such as degree symbol or plus/minus symbol, both of which we use), that row will fail to be imported. My personal impression is that it is being converted to UNICODE, which of course means that it becomes a two-byte character, and that means that this 255 char string is now 256 chars (bytes, actually, but you know what I mean), and can't be loaded into a varchar(255).
    We are willing to change our schema, but cannot do so until our next release. We need to get this release working on 9i, without changing the schema.
    Is it possible to import (using sqlldr) extended ASCII characters without changing them into Unicode characters?
    I have tried changing my NLS_LANG settings to US7ASCII (which is definitely wrong, it changes the extended chars into zeros) and I have tried WE8MSWIN1252, which does preserve the symbols, but does not preserve the ASCII encoding...
    I have tested the application against a changed schema ( just extended the varchar(255) to varchar(265)), so I know it works, but we've alreacy frozen this release, so I can't include the new schema...
    I am totally open to any suggestion that does not involve schema changes...
    Thank you,
    William

    My previous post is not really relevant to your problem.
    What character sets are you using in Oracle 8, Oracle 8i
    and Oracle 9i?
    For example:
    SQL> select * from nls_database_parameters
    2 where parameter = any('NLS_CHARACTERSET','NLS_NCHAR_CHARACTERSET');
    PARAMETER VALUE
    NLS_CHARACTERSET WE8ISO8859P15
    NLS_NCHAR_CHARACTERSET AL16UTF16
    According to Oracle's documentation,
    up to three character set conversions may be required for data definition language
    (DDL) during an export/import operation:
    1. Export writes export files using the character set specified in the NLS_LANG
    environment variable for the user session. A character set conversion is
    performed if the value of NLS_LANG differs from the database character set.
    2. If the export file's character set is different than the import user session
    character set, then Import converts the character set to its user session character
    set. Import can only perform this conversion for single-byte character sets. This
    means that for multibyte character sets, the import file's character set must be
    identical to the export file's character set.
    3. A final character set conversion may be performed if the target database's
    character set is different from the character set used by the import user session.
    To minimize data loss due to character set conversions, ensure that the export
    database, the export user session, the import user session, and the import database
    all use the same character set.

  • Non-ASCII character in Email field

    Hi Guys,
    I am trying to enter non-english characters in Email field of user form, but OIM throws an error that "A non-Ascii character has been entered". I have also tried to turn off the AppFirewall Filter in xlConfig.xml file but no help. Is there any way thay I can enter non-Ascii characters in Email field?
    Regards,
    Rahul

    .oO(surfinIan)
    >I have a script that converts a ms word document to text
    then uploads that to a
    >blob field on a mysql db.
    > During the conversion some characters my not be
    recognised. When i then call
    >up the blob for display on the browser...those characters
    show up as unknown
    >characters with a ? or box. Is there a way to
    preg_replace those unknown
    >characters before displaying them.
    What about fixing the encoding problem instead? If chars get
    lost during
    such a transfer
    document->script->database->script->browser it's always
    an encoding problem somewhere down the road.
    The recommendation these days is to use UTF-8, which avoids
    most of
    these old problems. You just have to make sure that your
    documents are
    properly stored as UTF-8 in the database and delivered as
    such to the
    script and the browser, then you don't have to worry about
    special chars
    anymore.
    That's just the general idea. I can't be more specific, since
    I don't
    know your conversion script or the database structure.
    Micha

  • Identify InfoObjects that have a non-7-bit-US-ASCII character in key

    Hello,
    we plan to do a Unicode migration with our BW. SAP recommends, that in order to prevent problems during data extraction all keys of the characteristic InfoObjects should only contain 7-bit-US-ASCII characters.
    But we have manually (by hazard) identified some master data records that contain some non-7-bit-US-ASCII characters (like for example "Ö" or "Ä").
    We'd now like to check ALL characteristic InfoObjects regarding this issue.
    Does anybody know about an ABAP-Report that would ease that task? Generally spoken, the programm should walk through the list of all characteristic InfoObjects and check for each one the master data table for "bad" keys (i. e. keys that contain a non-7-bit-US-ASCII character).
    Thanks to any answers in advance!
    Best regards,
    Philipp

    I tested your code today,
                         dialog           save           open
    Firefox 1.5          OK                 OK               OK
    IE 6.0                OK                 OK                NGdailog: filename show in download popup dialog
    save: save to disk from dialog
    open: open directly from dailog

  • Reading in Latin Extended-A character set from a text file

    Hello all,
    I am writing a small program that reads in a text file containing special characters (beyond the ASCII char set) and converting it into "regular" characters. For example I would read in a uaccent and replace it with a u.
    Now I realize that Unicode support is built into Java from ground up but it goes only so far, you actually have to have the relevant character set to read it. My code is as follows:
    InputStreamReader inStreamReader = new InputStreamReader(new FileInputStream("input.txt"), "ISO-8859-1");
    BufferedReader bufferedReader = new BufferedReader(inStreamReader);
    String line = null;
    StringBuffer buff = new StringBuffer();
    while((line = bufferedReader.readLine()) != null) {
    char[] charArray = line.toCharArray();
    for(int i = 0; i < charArray.length; i++) {
    int x = (int)charArray;
    switch(x) {
    case 224: // this is agrave .. we need to replace it with a
    buff.append('a');
    break;
    case 230: // this is aelig .. we need to replace it with ae
    buff.append("ae");
    break;
    ///////// and so on
    Since I am reading in as ISO-8859-1, this works up to unicode 255. For the rest of the characters, apparently I need a Latin Extended-A and Latin Extended-B character set. How can I get that installed on my Windows OS machine? I am using jdk 1.4.1 on Windows XP. Any help is appreciated.
    Thanks,
    -vk4t

    vkat wrote:
    Since I am reading in as ISO-8859-1, this works up to unicode 255. For the rest of the characters, apparently I need a Latin Extended-A and Latin Extended-B character set. How can I get that installed on my Windows OS machine? I am using jdk 1.4.1 on Windows XP. Any help is appreciated.If your file has characters outside of 8859-1's range (0 - 255), then it isn't ISO-8859-1 encoded. You need to know what encoding was used to store the file. It sounds like you it actually may be Unicode text, in which case you need to know which encoding (UTF8, UTF16, etc) was used.

Maybe you are looking for