Category : character-encoding

This is a really quick question: what is the character encoding used in symbolic ref files like .git/HEAD, especially on Windows? Is it the same as the filesystem’s encoding? It sounds improbable, though, since I’ve heard before that Windows’ filesystem encoding is UTF-16 and ASCII control bytes 0x00..0x1F and 0x7F is prohibited in Git ref ..

Read more

I have a C++ interface that contains the following: extern "C" { char const* getValForEntry(Entry e) { std::string no_val = "__err::no_val"; if (handles.find(e) != handles.end()) { std::string val = handles[e]->get_value(); return val.c_str(); } else return no_entry.c_str(); } } I have a python app that connects to this interface with ctypes like so: self.lib.getUpdateForEntry.restype = c_char_p ..

Read more

I have cython code which encodes a string and pass it over c++ implementation. Like cpp_model.fit(right.encode(‘cp1251’), wrong.encode(‘cp1251′)) I’ve stored data in file and wanna to encode it directly from c++. Is there a way to get a kind of such translation to byte-string нимесил -> b’xedxe8xecxe5xf1xe8xeb’ in c++? Source: Windows Que..

Read more