codepages

What characters do not directly map from Cp1252 to UTF-8?

跟風遠走 提交于 2019-12-03 00:05:04
I've read in several stackoverflow answers that some characters do not directly map (or are even "unmappable") when converting from Cp1252 (aka Windows-1252; they're the same, aren't they?) to UTF-8, e.g. here: https://stackoverflow.com/a/23399926/2018047 Can someone please shed some more light on this? Does that mean that if I batch/mass convert source code from cp1252 to utf-8 I'll get some characters that will end up as garbage? This is how Windows 1252 codepage looks like. As you can see, bytes 0x81, 0x8D, 0x8F, 0x90, 0x9D do not have anything assigned to them. If your input file contains

Running BAT/CMD file with accented characters in it

可紊 提交于 2019-12-02 19:27:34
I have a Windows batch file which has an instruction to execute an EXE file in a location whose path contains accented characters. Following are the contents of the batch file. @echo off C:\español\jre\bin\java.exe -version C:\español\jre\bin\java.exe - This path exists and is proper. I can run this command directly on cmd.exe. But when I run the command from a bat/cmd file it fails saying "The system cannot find the path specified" One way to fix this is by setting code page to 1252 (that works for me). But I'm afraid we'd have to set code pages for any non-English locale and figuring out

Advantage Database Index Collation Sequence

北慕城南 提交于 2019-12-01 21:42:07
I am converting a Delphi program from the BDE to Advantage Database. On weekends I work on a Win 7 machine using Delphi XE. During the week I work on a Win XP machine using Delphi 7. Advantage tables work fine on the Win 7 machine but when copied to the XP machine they cannot be accessed - Error 5175 the index was created with a different collation sequence I have searched the net, even gone into the Advantage forums but can't find anything helpful. The XP and Win 7 are both set up the same as regards location etc. Table properties lists the collation sequence as blank. Anyone know what is

How to Convert UTF-8 Arabic letters to CodePage 1001?

ぐ巨炮叔叔 提交于 2019-12-01 21:29:21
I have a Star Micronics TSP that supports CodePage 1001 Arabic, how do I convert UTF-8 to that specific code page using C#? Update: I found out that CodePage 864 is compatible with the printer, I tried sending hex values and I got the correct character, myPrinter.PrintNormal(PrinterStation.Receipt, "\xFE8D"); I tried the following to convert a string to codePage 864: Encoding enc = Encoding.GetEncoding(864); byte[] arr = enc.GetBytes("السلام"); the byte arr values i'm getting after the encoding is {63,63,63,63,63,63} which is wrong in value and even the byte count is wrong because its a double

How to change the CP_ACP(0) of windows ANSI apis in an application?

点点圈 提交于 2019-12-01 20:17:27
I try to draw text using a dll library which has only interfaces of ANSI version encapsulated windows ANSI apis, but I need to store string data using utf-8. I don't want to convert strings using MultiByte/WideChar functions so I want an approach to change the CP_ACP in my application, so that I can input string data into ANSI apis. thanks. ps: I don't to change the system default codepage. CP_ACP represents the system Ansi codepage. You cannot change that on a per-process or per-thread basis. It is a system-wide setting. If the DLL really is dependant on CP_ACP internally, then you have no

Codepage 850 works, 65001 fails! There is NO response to “call foo.cmd”. internal commands work fine

杀马特。学长 韩版系。学妹 提交于 2019-12-01 18:23:53
The question basically explains the problem. I'm using Windows XP Pro Service Pack 3 ComSpec=C:\WINDOWS\system32\cmd.exe I launched the console via Start... Run-dialog... cmd.exe Here is a "view" of my console: The command, then the output (and my // comments) C:\> chcp 850 Active code page: 850 // output is as expected C:\> echo @chcp ^& REM 850>test850.cmd // no output; as ecpected) C:\> type test850.cmd @chcp & REM 850 // output is as expected C:\> call test850.cmd Active code page: 850 // output is as expected The above works fine (as expected). Things are happy in Windows-land, but the

Flow of raw bytes of string literal into/out of the Windows (non-wide) execution character set at compile/runtime, & ANSI code pages vs. UTF-8

笑着哭i 提交于 2019-12-01 13:02:41
问题 I would like confirmation regarding my understanding of raw string literals and the (non-wide) execution character set on Windows. Relevant paragraphs for which I desire specific confirmation are in BOLD. But first, some background. BACKGROUND (relevant questions are in the paragraphs below in bold ) As a result of the helpful discussion beneath @TheUndeadFish's answer to this question that I posted yesterday, I have attempted to understand the rules determining the character set and encoding

How to read EBCDIC data with a non standard codepage, and not mess up numbers?

[亡魂溺海] 提交于 2019-12-01 11:19:27
Here is one for the old(er) hands :-) I'm reading a binary dump from a mainframe DB2 table. The table has varchar, char, smallint, integer and float columns. To make it interesting, the DB2 uses code page 424 (Hebrew). I need my code to be codepage independent. So I open the file with a streamreader using System.Text.Encoding like so: Dim encoding As System.Text.Encoding = System.Text.Encoding.GetEncoding(20424) Dim sr As New StreamReader(item.Key, encoding) and proceed to read the VARCHAR and CHAR data according to their lengths into char arrays using sr.ReadBlock(buffer, 0, iFieldBufferSize)

How to read EBCDIC data with a non standard codepage, and not mess up numbers?

那年仲夏 提交于 2019-12-01 09:38:35
问题 Here is one for the old(er) hands :-) I'm reading a binary dump from a mainframe DB2 table. The table has varchar, char, smallint, integer and float columns. To make it interesting, the DB2 uses code page 424 (Hebrew). I need my code to be codepage independent. So I open the file with a streamreader using System.Text.Encoding like so: Dim encoding As System.Text.Encoding = System.Text.Encoding.GetEncoding(20424) Dim sr As New StreamReader(item.Key, encoding) and proceed to read the VARCHAR

Save INI file in UTF-8 rather than ANSI in Inno Setup

时间秒杀一切 提交于 2019-12-01 07:08:00
问题 I'm starting to use Inno Setup, and I have some problems with my INI file encoding. I want to save user input in the INI file, and this input can contain accents. I use Inno Setup Unicode, my setupScript.iss is UTF-8 encoded, and here is my code (a part) : [INI] Filename: "{app}\www\conf\config.ini"; Section: "Settings"; Key: "ca.plafondAnnuel"; String: "{code:GetUser|Plafond}" Filename: "{app}\www\conf\config.ini"; Section: "Settings"; Key: "app.siren"; String: "{code:GetUser|Siren}"