aboutsummaryrefslogtreecommitdiffstats
path: root/modules/charset
Commit message (Collapse)AuthorAgeFilesLines
* Don't treat BOM escape sequence as hidden character. (#18909)Gusted2022-02-262-4/+25
| | | | | | | | | | | * Don't treat BOM escape sequence as hidden character. - BOM sequence is a common non-harmfull escape sequence, it shouldn't be shown as hidden character. - Follows GitHub's behavior. - Resolves #18837 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix panic in EscapeReader (#18820)zeripath2022-02-192-0/+10
| | | | | | There is a potential panic due to a mistaken resetting of the length parameter when multibyte characters go over a read boundary. Signed-off-by: Andrew Thornton <art27@cantab.net>
* format with gofumpt (#18184)65432022-01-202-33/+65
| | | | | | | | | | | * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
* Add warning for BIDI characters in page renders and in diffs (#17562)zeripath2022-01-072-0/+432
| | | | | | | | | | | | Fix #17514 Given the comments I've adjusted this somewhat. The numbers of characters detected are increased and include things like the use of U+300 to make à instead of à and non-breaking spaces. There is a button which can be used to escape the content to show it. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Gwyneth Morgan <gwymor@tilde.club> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Simplify parameter types (#18006)Gusted2021-12-201-3/+3
| | | Remove repeated type declarations in function definitions.
* Read expected buffer size (#17409)KN4CK3R2021-10-241-2/+3
| | | | | | * Read expected buffer size. * Changed name.
* refactor: move from io/ioutil to io and os package (#17109)Eng Zer Jun2021-09-221-2/+1
| | | | | | | | | The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Refactor renders (#15175)Lunny Xiao2021-04-191-18/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor renders * Some performance optimization * Fix comment * Transform reader * Fix csv test * Fix test * Fix tests * Improve optimaziation * Fix test * Fix test * Detect file encoding with reader * Improve optimaziation * reduce memory usage * improve code * fix build * Fix test * Fix for go1.15 * Fix render * Fix comment * Fix lint * Fix test * Don't use NormalEOF when unnecessary * revert change on util.go * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> * rename function * Take NormalEOF back Co-authored-by: zeripath <art27@cantab.net>
* Ensure that the detected charset order is set in chardet test (#12574)zeripath2020-08-231-5/+23
| | | | | | | | | | | | | | | TestToUTF8WithFallback is the cause of recurrent spurious test failures even despite code to set the detected charset order. The reason why this happens is because the preferred detected charset order is not being initialised for these tests. This PR simply ensures that this is set at the start of each test and would allow different tests to be written to allow differing orders. Replaces #12571 Close #12571 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix chardet test and add ordering option (#11621)zeripath2020-06-022-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix chardet test and add ordering option Signed-off-by: Andrew Thornton <art27@cantab.net> * minor fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * remove log Signed-off-by: Andrew Thornton <art27@cantab.net> * remove log2 Signed-off-by: Andrew Thornton <art27@cantab.net> * only iterate through top results Signed-off-by: Andrew Thornton <art27@cantab.net> * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md * slight restructure of for loop Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* deps: update and fix chardet import (#9351)Antoine GIRARD2019-12-141-1/+1
|
* Reduce test sensibility (#8393)guillep2k2019-10-071-1/+2
|
* Fix utf8 tests (#8192)guillep2k2019-09-212-35/+81
| | | | | | | | * Prevent compiler environment from making the tests fail * Remove unused function * Pass lint
* Make encoding tests independent of LOCALE settings (#8018)guillep2k2019-09-021-12/+26
| | | | | | | | * Make encoding tests independent of LOCALE settings * Fix fmt * Force CI to restart
* Convert files to utf-8 for indexing (#7814)guillep2k2019-08-152-0/+343
* Convert files to utf-8 for indexing * Move utf8 functions to modules/base * Bump repoIndexerLatestVersion to 3 * Add tests for base/encoding.go * Changes to pass gosimple * Move UTF8 funcs into new modules/charset package