codepages

.NET character encoding problems

I've got some problems on a .NET site where both Latin (åäö) and Latvian (āē) characters would need to co-exist. In the database, I'm using nvarchar and ntext for my fields, and if I enter the texts directly into the database, everything works fine. The problem is when I enter the exact same text using a form that does an SQL UPDATE, t...

Outlook is unable to accept french-accented characters in my mailto string?

Outlook is causing some problems when being passed a mailto string with accented characters in it. Changing the codepage for my entire webpage that has this string on it solves this problem, but that causes other problems in the system, so I would not like to do that. A string like such returns a lot of garbage characters: "mailto:H...

Db2: no available conversion for the source page

I'm usind db2 8. Try to connect to the database (on the remotee computer, using vpn). While connecting I have an error: SQL0332N There is no available conversion for the source code page "1251" to the target code page "UNKNOWN". Reason Code "1". SQLSTATE=57017 I tried to set DISABLEUNICODE=1 in db2cli.ini, and aslo tried to set db2...

Does Ruby auto-detect a file's codepage?

If a save a text file with the following character б U+0431, but save it as an ANSI code page file. Ruby returns ord = 63. Saving the file with UTF-8 as the codepage returns ord = 208, 177 Should I be specifically telling Ruby to handle the input encoded with a certain code page? If so, how do you do this? ...

SQL Server: Code page translations are not supported for the text data type.

When inserting text into a TEXT column in SQL Server using ADO, i get the error: Code page translations are not supported for the text data type. From: 1257 To: 1252. Now it is true that i've changed my Windows code page to 1257 (Estonian). My question is: How does SQL Server know what code page i'm running in? All strings sent t...

Setting the correct codepage for a database read operation

How can I change the codepage I want to use on an operation such as the one below? string foo = (string)sqlCommand.ExecuteScalar(); As I understand I can wrap the method call inside a String.Format(IFormatProvider, String). That would be grand. But how do I construct a IFormatProvider with a specific codepage so I can correctly read ...

Specifying codepage for PInvoke string marshalling using C#

I am calling a DLL using PInvoke. The DLL's function returns a C string in codepage 437. Is there a way to have the .Net marshaling convert the string to unicode, or could someone suggest which parameters I should give to DllImport() and MarshalAs() and a conversion function to use in order to get an output in unicode? For reference, t...

SQL Server 2005 CodePage Issue

I have a problem I am trying to resolve. We have a SQL Server 2005 running a commercial ERP system. The implication for this is that we cannot change the database structure and all of the character fields are CHAR or VARCHAR rather than Unicode types (NCHAR, NVARCHAR). We also have multiple instances of the ERP software, based on countr...

Java 1.6 Windows-1252 encoding fails on 3 characters

EDIT: I've been convinced that this question is somewhat non-sensical. Thanks to those who responded. I may post a follow-up question that is more specific. Today I was investing some encoding problems and wrote this unit test to isolate a base repro case: int badCount = 0; for (int i = 1; i < 255; i++) { String str = "Hi " + ne...

string incorrectly translated by ado

I have a database with collation SQL_Latin1_General_CP1_CI_AS. In that database I have a varchar field. There is a row in that database with the string "ó" (single character 243 in codepage 1252). I have a simple ASP page that sets the codepage to 65001, reads that row (using adodb), and sends it out to the browser. Everything works ...

How do I change the code page MS Visual Studio 2008 uses to open files?

Hi. I have a cpp file that uses ibm cp437 and Visual C++ keeps reading it with windows-1252. How do I make Visual C++ use the right code page for the file? ...

How to find if a character belongs to a particular codepage using c++ or calling winapi

How can we find if a character belongs to a particular codepage? or How can we determine whether a charcter fits into currently active IME for an application. ...

ABAP WebAS Active Codepage

Hello! I need to concatenate different lines in a string. To do so, I need to use CR + LF hexadecimal characters. The problem is that, when I'm using an 8 bit/char environment, I just need to do something like this: constants : c_lf type x value '10'. constants : c_cr type x value '13'. data : g_html type string. concatenate '<htm...

How to get encoding from MAPI message with PR_BODY_A tag (windows mobile)?

Hi, everyone! I am developing a program, that handles incoming e-mail and sms through windows-mobile MAPI. The code basically looks like that: ulBodyProp = PR_BODY_A; hr = piMessage->OpenProperty(ulBodyProp, NULL, STGM_READ, 0, (LPUNKNOWN*)&piStream); if (hr == S_OK) { // ... get body size in bytes ... STATSTG ...

CodePage ID to CodePage name: GetEncoding equivalent in Delphi?

Hello all, I'm looking for a Win32 equivalent of the .Net Encoding.GetEncoding Method to be used in Delphi7. What I would like to achieve is to convert a Codepage ID (ie.: 28592) to a Codepage name (iso-8859-2 in this case). I've found a Win32 function called GetCPInfoEx, but that returns a long CodePage name, and I need the short one...

Delphi Standard Input Output Code page

Delphi 2010 When reading from file using readLn procedure, by default i get unicode string converted from code page 1251 (code page of windows). How can i change this and read from file in other code page, in 1252 or UTF16 ? ...

SQL Server -> 'SQL_Latin1_General_CP1_CI_AS' Collation -> Varchar Column -> Languages Supported

All, We are using SQL Server 2008 with Collation Setting as 'SQL_Latin1_General_CP1_CI_AS'. We are using Varchar column to store textual data. We know that we cannot store Double Byte data in Varchar column and hence cannot support languages like Japanese and Chinese without converting it to NVarchar. However, will it be safe to say t...

What is the CodePage for DBCS so I can encode an xml string and show it in a asp.net text box?

What is the CodePage for DBCS so I can encode an xml string and show it in a asp.net text box? I don't think I should have to convert the characters myself when Server.HTMLEncode will work if the string is DBCS. To clarify: the binary represenation of the xml string(Base64) is stored in the database in a column of nvarchar(max) datatyp...

What is the most robust way to determine the current codepage from a shell script?

Hi all, I'd like to determine the environment's current codepage at runtime from a Unix shell script. What's the most reliable way of doing this? I'm looking into parsing environment variable $LC_ALL, but it isn't always set to a useful value, and its format seems to vary (can be <locale>, or <locale>.<code page>, or <locale>.<code pag...

Programmatically change the default code page in Windows XP? (from Delphi)

Could anyone advise how to programmatically change the default Windows XP code page (I'm doing this from Delphi)? (This would be the equivalent of going into Control Panel -> Regional Settings -> Language for non-Unicode applications). In this case, I want to switch to Chinese (PRC) and so am writing to the following registry strings: ...