utf-16

Why doesn't GIT natively support UTF-16

泄露秘密 提交于 2019-11-29 15:01:07
问题 Git supports several different encoding schemes: UTF-7 , UTF-8 , UTF-32 , as well as non-UTF ones. Given this, why doesn't it support UTF-16 ? There's a lot of questions that ask how to get git to support UTF-16, but I don't think that this has been explicitly asked or answered yet. 回答1: I devote a significant chunk of a full chapter of my (currently rather moribund) book (see Chapter 3, which is in better shape than later chapters) to the issue of character encoding, because it is a

UCS-2 and SQL Server

℡╲_俬逩灬. 提交于 2019-11-29 14:44:17
While researching options for storing mostly-English-but-sometimes-not data in a SQL Server database that can potentially be quite large, I'm leaning toward storing most string data as UTF-8 encoded. However, Microsoft chose UCS-2 for reasons that I don't fully understand which is causing me to second-guess that leaning. The documentation for SQL Server 2012 does show how to create a UTF-8 UDT , but the decision for UCS-2 presumably pervades SQL Server. Wikipedia (which interestingly notes that UCS-2 is obsolete in favor of UTF-16) notes that UTF-8 is a variable-width character set capable of

Firefox and UTF-16 encoding

时光毁灭记忆、已成空白 提交于 2019-11-29 14:35:53
I'm building a website with the encoding UTF-16. It means that every files (html,jsp) is encoded in UTF-18 and I set in the head of every HTML page : <meta http-equiv="content-type" content="text/html; charset=UTF-16"> My index page is correctly displayed by Chrom and IE. However, firefox doesn't render the index. It displays 2 strange characters and the full index page code : ��<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-16"> ... Do you know the reason? It should be a problem of encoding, but I don't know where it's located... Thanks

Open mails in outlook from java using the protocol “mapi://”

旧城冷巷雨未停 提交于 2019-11-29 12:26:24
I developp a Java application using Windows Desktop Search from which I can retrieve some information about files on my computer such as urls ( System.ItemUrl ). An example of such url is file://c:/users/ausername/documents/aninterestingfile.txt for "normal" files. This field give also urls of mail items indexed from Outlook or Thunderbird. Thunderbird's items (only available using vista and seven) are also files (.wdseml). But outlook's items urls start with "mapi://" like : mapi://{S-1-5-21-1626573300-1364474481-487586288-1001}/toto@mycompany.com($b423dcd5)/0/Inbox/가가가가곕갘객겒갨겑곓걌게겻겨곹곒갓곅갩갤가갠가

How to best deal with Windows' 16-bit wchar_t ugliness?

点点圈 提交于 2019-11-29 12:23:35
I'm writing a wrapper layer to be used with mingw which provides the application with a virtual UTF-8 environment. Functions which deal with filenames are wrappers which convert from UTF-8 and call the corresponding "_w" functions, and so on. The big problem I've run into is that Windows' wchar_t is 16-bit. For filesystem operations, it's not a big deal. I can just convert back and forth between UTF-8 and UTF-16, and everything will work. But the standard C multibyte/wide character conversion API does not allow multi-wchar_t characters. Possible solutions: Provide a CESU-8 environment instead

How to convert UTF-8 encoded std::string to UTF-16 std::string

心不动则不痛 提交于 2019-11-29 12:22:57
How can i convert UTF-8 encoded std::string to UTF-16 std::string? Is it possible? And no, i can't use std::wstring in my case. Windows, MSVC-11.0. How about trying like this:- std::string s = u8"Your string"; // #include <codecvt> std::wstring_convert<std::codecvt<char16_t,char,std::mbstate_t>,char16_t> convert; std::u16string u16 = convert.from_bytes(s); std::string u8 = convert.to_bytes(u16); Also check this for UTF to UTF conversion. From the docs:- The specialization codecvt converts between the UTF-16 and UTF-8 encoding schemes, and the specialization codecvt converts between the UTF-32

platform specific Unicode semantics in Python 2.7

时光总嘲笑我的痴心妄想 提交于 2019-11-29 12:21:29
Ubuntu 11.10: $ python Python 2.7.2+ (default, Oct 4 2011, 20:03:08) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> x = u'\U0001f44d' >>> len(x) 1 >>> ord(x[0]) 128077 Windows 7: Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> x = u'\U0001f44d' >>> len(x) 2 >>> ord(x[0]) 55357 My Ubuntu experience is with the default interpreter in the distribution. For Windows 7 I downloaded and installed the recommended version linked from python.org.

SAP Java GUI integration log

送分小仙女□ 提交于 2019-11-29 11:46:27
!ENTRY com.jerry.adt.logging 1 0 2012-07-28 12:54:34.144 !MESSAGE [INFO] Java Gui uses requestUser WANGJER, ideUser WANGJER, terminalId: null, ideId: null !ENTRY com.jerry.adt.logging 1 0 2012-07-28 12:54:34.456 !MESSAGE [INFO] Connect job starting … !ENTRY com.jerry.adt.logging 1 0 2012-07-28 12:54:34.456 !MESSAGE [INFO] Found jerry GUI installation directory C:\Program Files (x86)\jerry\FrontEnd\jerrygui\ !ENTRY com.jerry.adt.logging 1 0 2012-07-28 12:54:37.654 !MESSAGE [INFO] Pipe created: \.\pipe\AiEWinguiEventpipe-7632AE745C5D1C47E0EAA99C0ED90F5-1343451274456 !ENTRY com.jerry.adt.logging

How to use Boost Spirit to parse Chinese(unicode utf-16)?

对着背影说爱祢 提交于 2019-11-29 11:30:56
My program does not recognize Chinese. How to use spirit to recognize Chinese? I use wstring and has convert it to utf-16. Here is my header file: #pragma once #define BOOST_SPIRIT_UNICODE #include <boost/spirit/include/qi.hpp> #include <string> #include <vector> #include <map> using namespace std; namespace qi = boost::spirit::qi; namespace ascii = boost::spirit::ascii; typedef pair<wstring,wstring> WordMeaningType; typedef vector<WordMeaningType> WordMeaningsType; typedef pair<wstring,WordMeaningsType> WordType; typedef vector<WordType> WordListType; struct WordPaser :qi::grammar<wstring:

How to convert a utf-8 string to a utf-16 string in PHP

a 夏天 提交于 2019-11-29 09:40:38
How do I convert a utf-8 string to a utf-16 string in PHP? mbstring supports UTF-16 , so you can use mb_convert_encoding . Jesper Grann Laursen You could also use iconv . It's native in PHP, but require that all your text is one charset. Else it could discard characters. 来源: https://stackoverflow.com/questions/155514/how-to-convert-a-utf-8-string-to-a-utf-16-string-in-php