summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/unicode.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove stuffNicholas Feinberg2014-07-291-0/+5
| | | | | | | .cc, moving its contents into the new stepdown.cc and strings.cc. (The latter also got many donations from libutil.h.) Down with stuff! Up the new flesh!
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-1/+0
| | | | | Sometimes, they're there to emphasize a break between two sections of code, which is good. In a majority of cases, though, they're just inconsistent.
* Use std namespace.Raphael Langella2012-08-261-11/+11
| | | | | | | | | | | | | 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-0/+4
| | | | | | | 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.).
* Death to std::wstringstream!Adam Borowski2012-08-121-4/+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.
* Don't use locale-dependent %ls.Adam Borowski2012-07-011-0/+4
| | | | | While webtiles are not supported on Windows, and no sane Unix uses encodings other than UTF-8, we can have local webtiles some day.
* Hide output charset conversions behind a macro.Adam Borowski2011-04-181-0/+10
| | | | | | They're not that interesting and cloud code readability. What humans care about is the conversion of Crawl's internal format to native strings (OUTS) or native wide strings (OUTW, Windows only).
* Make cset overrides more sane.Adam Borowski2011-04-011-0/+2
| | | | | | | 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/+5
| | | | | | | | | 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/+14
| | | | | | | | | | | | | | | 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).
* Add Markus Kuhn's wcwidth(). All libcs but Windows ship it already...Adam Borowski2010-12-171-0/+4
| | | | | | | I had to change wchar_t to ucs_t, as Windows cripples it to 16 bits, making it impossible to support most of Unicode. 32 bits will allow proper behaviour at least in tiles -- and we might replace the win32 console as well.
* Rename TextFileReader to FileLineInput I didn't notice, use it for config files.Adam Borowski2010-12-161-4/+17
|
* A reader for Windows-style BOMmed files.Adam Borowski2010-12-161-0/+22
|
* Convert ofstream to fprintf() for stash dumps. Translate charsets.Adam Borowski2010-12-161-0/+1
| | | | | Using ofstream requires huge hacks on Polish/Russian/etc Windows, and is outright impossible on Vietnamese.
* Always use Unicode values for glyphs. Always use ncursesw on Unix console.Adam Borowski2010-09-261-2/+0
| | | | | | | | | | | | CSET_IBM and CSET_DEC are now merely presets and don't change the I/O encoding. Doing I/O using any encoding other than the one configured using LANG/LC_* is just wrong and no well-behaving program should do that. This does require changes on CAO/CDO, but they would fix problems with ttyrec and spectating as well. To fix: ncursesw replaces unrepresentable characters with spaces, we'll have to replace them by hand.
* Basic charset conversions: local<->utf8<->utf16.Adam Borowski2010-09-161-0/+27
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.