cp1252

PHP Regex delimiter

廉价感情. 提交于 2019-12-12 09:27:03
问题 For a long time, any time I've needed to use a regular expression, I've standardized on using the copyright symbol © as the delimiter because it was a symbol that wasn't on the keyboard that I was sure to not use in a regular expression, unlike ! @ # \ or / (which are sometimes all in use within in a regex). Code: $result=preg_match('©<.*?>©', '<something string>'); However, today I needed to use a regular expression with accented characters which included this: Code: [a-zA

Can source code files with different encoding coexist in (the same) Java (project in Eclipse)?

我只是一个虾纸丫 提交于 2019-12-11 22:19:58
问题 I know Java uses UTF-16 internally and expects .properties files to be in ISO-8859-1 by default. I'm currently working on a project that was written in Eclipse, whose default encoding on our systems is cp-1252. I'm thinking utf-8 would be a much more sensible option, going forward. However, given the scale of the project (it's split up into modules and uses libraries from all over the place), I can't just batch-convert all source code files in one go. Will Java have a problem with some files

Why is my implementation of Simplified DES working fine under Cp1252 encoding but not under UTF-8?

笑着哭i 提交于 2019-12-11 17:51:42
问题 I asked the following question yesterday but it didn't get much attention due to the fact that I didn't really include any details about my actual problem. Eclipse:Using UTF-8 encoding in the text editor make the Strings not work properly, how can I fix that? I will try to analyze my problem as much as possible in order to give you a clear insight on what's going on. I have a university project where I am supposed to implement the Simplified DES algorithm for educational purposes. This

converting String from Windows charset to UTF 8 in Java

こ雲淡風輕ζ 提交于 2019-12-11 09:06:46
问题 so I have to give some arguments to my Java app which is called from a .bat file. Doing this makes the arguments have the system's charset encoding, which makes some characters displayed wrongly. I tried this String titulo; titulo = new String (args[1].getBytes(),"Cp1252"); also tried with a few others from this list http://docs.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html and none of them succeeded. How else can I encode a String from Windows charset to Java's UTF 8? Thanks a

Python pipe cp1252 string from PowerShell to a python (2.7) script

谁说胖子不能爱 提交于 2019-12-11 08:01:43
问题 After a few days of dwelling over stackoverflow and python 2.7 doc, I have come to no conclusion about this. Basically I'm running a python script on a windows server that must have as input a block of text. This block of text (unfortunately) has to be passed by a pipe. Something like: PS > [something_that_outputs_text] | python .\my_script.py So the problem is: The server uses cp1252 encoding and I really cannot change it due to administrative regulations and whatnot. And when I pipe the

Windows C API for UTF8 to 1252

爱⌒轻易说出口 提交于 2019-12-11 01:40:44
问题 I'm familiar with WideCharToMultiByte and MultiByteToWideChar conversions and could use these to do something like: UTF8 -> UTF16 -> 1252 I know that iconv will do what I need, but does anybody know of any MS libs that will allow this in a single call? I should probably just pull in the iconv library, but am feeling lazy. Thanks 回答1: Windows 1252 is mostly equivalent to latin-1, aka ISO-8859-1: Windows-1252 just has some additional characters allocated in the latin-1 reserved range 128-159.

Cygwin terminal not displaying certain characters?

不想你离开。 提交于 2019-12-10 19:47:12
问题 I am running a stock Cygwin install, with the wget package added. If I run a command wget -qO- tetristv.com/zapni.tv.php I get this; notice the incorrect display of characters session=OTA5Mjc0ODU5OA==&stream=play</a></b><br>#EXTINF:0,▒T 1<br><b><a href="http://212.80.69.19/stream/vlc.php?id=39&session=OTA5Mjc0ODU5OA==& stream=play" target="_blank" rel="nofollow">http://212.80.69.19/stream /vlc.php?id=39&session=OTA5Mjc0ODU5OA==&stream=play</a></b><br>#EXTINF:0,▒T 2<br><b><a href="http://212

Bulk convert cp1252 to utf-8 in Windows

寵の児 提交于 2019-12-09 18:36:16
问题 So, I've been trying to convert a large java source tree from cp1252 to UTF-8 in Windows, using tips and trix I've found online, specificly here. Problem is, I'm on Windows; I don't do VB; Cygwin's iconv doesn't take the -o switch. The line I first tried to use is: find . -type f -print -exec iconv -f cp1252 -t utf-8 {} > {}.converted \; -exec mv {}.converted {} \; This creates a file {}.converted in the working directory and the second -exec fails for obvious reasons. Putting quotes around

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

青春壹個敷衍的年華 提交于 2019-12-09 04:21:16
问题 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? 回答1: This is how Windows 1252 codepage looks like. As you can

How to convert an UTF String to ANSI and Create an ANSI text file in SSD with JAVA-ANDROID

不羁岁月 提交于 2019-12-09 01:12:04
问题 I wrote a android app in java to get user answers and save them in a file. The problem is that this file is saved in utf-8. The end user will open these files in the IBM SPSS, an application for windows that can read files only in ANSI (windows-1252). How do I create files in ANSI code to save in a ssd-card from java-android app? I think I know that to convert Strings to ANSI I should use: String unicode = new String(asciiBytes, "windows-1252"); Is that correct? My code to save the file is