summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/unicode.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add a few #includes to avoid missing-declaration warnings.Neil Moore2013-04-071-0/+1
|
* Staticify.Adam Borowski2013-04-071-0/+3
|
* fixed compilation bug under AndroidChris West2013-01-191-18/+18
|
* Don't use a yet another utf8_to_wc implementation for no-op conversions.Adam Borowski2013-01-061-225/+12
| | | | | | | | | Since Android already uses UTF-8 only (in versions that are not 7 bit), there's no need to do anything since our internal representation is UTF-8 as well. Even if we did need an UTF-8 <-> wchar_t converter, there's already one in this very file.
* added unicode calls from Crystax so that we can use latest android ndkChris West2013-01-051-2/+225
|
* Indentation fixes.Adam Borowski2012-12-051-3/+3
|
* Use std namespace.Raphael Langella2012-08-261-20/+20
| | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
* Eradicate remaining uses of std::wstring on non-Windows.Adam Borowski2012-08-121-4/+6
| | | | | | | They cause problems on Android, and were slightly wrong anyway (if a single line of an included config file is encoded in UTF-16 and has a monstrous length, we'd waste twice as much memory as needed to hold it. A world-shattering bug.).
* Don't pointlessly define utf8_to_16() on non-Windows.Adam Borowski2012-08-121-0/+3
| | | | While it's not much code by itself, instantiating std::wstring templates is.
* Death to std::wstringstream!Adam Borowski2012-08-121-17/+0
| | | | | | | There's no point in accumulating a string of wchar_t and then immediately converting it to utf8 if we can accumulate it in utf8. This solves problems on Windows and Android (neither of whom can run webtiles servers currently) and reduces the code size somewhat.
* Fix a typo/endless loop in wcstoutf8.Florian Diebold2012-07-011-1/+1
|
* Don't use locale-dependent %ls.Adam Borowski2012-07-011-0/+17
| | | | | While webtiles are not supported on Windows, and no sane Unix uses encodings other than UTF-8, we can have local webtiles some day.
* Don't loop infinitely with a Russian profanity in no-asserts builds.Adam Borowski2012-06-181-2/+1
| | | | It's a "can't happen" case, though.
* Consistently use a space after flow control statements.Adam Borowski2011-12-021-9/+9
|
* Fix a build failure when libutil.h is included from the global header.Adam Borowski2011-10-131-2/+2
|
* Combine common parts of lib*.hAdam Borowski2011-09-081-0/+1
| | | | | Having different prototypes for different ports without a good reason is bad. After unification, it's easier to have, for example, two ports at once.
* Fix dump output corruption in non-UTF8 locales.Adam Borowski2011-04-141-1/+1
|
* Fix some strings being truncated.Adam Borowski2011-04-011-1/+1
|
* Correct non-ASCII weapon inscriptions being possibly corrupted.Adam Borowski2011-04-011-0/+27
|
* Make cset overrides more sane.Adam Borowski2011-04-011-0/+61
| | | | | | | You don't need to specify the charset anymore, save for cset_ibm and cset_dec which are for compatibility with legacy config files. You can even use cset_ibm without char_set=ibm, it will work.
* Doxygen header.Adam Borowski2011-03-311-6/+5
|
* Unicode support in the line_reader, including CJK and combining.Adam Borowski2011-03-311-0/+37
| | | | | | | | | There are sadly some redraw errors when there's line-wrapping involved, especially if you're editing something not at the end of the buffer, but these appear to be not regressions so I left them for now. I am tempted to just brute-force it by redrawing the whole thing and let ncurses optimize it...
* Get rid of one last use of fstream.Adam Borowski2010-12-181-0/+40
| | | | | | | | | | | | | | | The database files are assumed to be always in UTF-8. This can make editing them harder on Windows (some editors do cope, even notepad), but assuming the system's locale would break running directly from git without installing. Current uses are merely: (all in quotes.txt) * "Alain René" * "Rabbi Löw" * "Öland" * "Min son på galejan" * typographical apostrophes but it's likely it will be a bigger issue in the future (and if we ever do translations, a lot bigger).
* Make strwidth() actually do what it's supposed to.Adam Borowski2010-12-171-0/+21
|
* Rename TextFileReader to FileLineInput I didn't notice, use it for config files.Adam Borowski2010-12-161-3/+3
|
* A reader for Windows-style BOMmed files.Adam Borowski2010-12-161-2/+201
|
* Basic charset conversions: local<->utf8<->utf16.Adam Borowski2010-09-161-0/+217
Their intended use is: * local: config files, morgues. File names (non-Windows). * utf8: everything internal. Data files (des, database). * utf16: (Windows only) file names and similar syscalls. On Unix systems, the "local" charset is in a vast majority of cases UTF-8, but we can't rely on that and have to convert anyway.