summaryrefslogtreecommitdiffstats
path: root/base/string_util_icu.cc
Commit message (Collapse)AuthorAgeFilesLines
* Move TrimWhitespaceUTF8 back to string_util_utf8.ccdeanm@chromium.org2009-07-151-0/+17
| | | | | | | | | Apparently it was there for a reason, but wasn't documented. Review URL: http://codereview.chromium.org/155511 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20727 0039d316-1c4b-4281-b951-d872f2087c98
* Move TrimWhitespaceUTF8 from string_util_icu to string_util.deanm@chromium.org2009-07-131-14/+0
| | | | | | | | | It does not directly use ICU, so this is its proper home. Review URL: http://codereview.chromium.org/155415 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20492 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the local directory listing, FTP directory listing and the local file ↵jshin@chromium.org2009-07-091-79/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | handling (drag'n'drop and opening from the file list). For the local file listing, use the OS file system encoding. For the FTP directory listing, use ICU's encoding detector.GetDirectoryListingEntry and GetDirectoryLisingHeader were changed to accept string16 for file/directory names. To the former, a new parameter (|raw_bytes|) was added. It can be used to make a FTP request to a file with a non-ASCII name encoded in a legacy encoding. For the local file handling on Windows, get rid of the code for 'doubly converted' UTF-8 in FileURLToFilePath, which led to issue 4619 and add a few cases to NetUtil*.FileURLConversion* test. In addition, add CodepageToUTF16 and UTF16ToCodepage along with a new unittest (ConvertBetweenCodepageAndUTF16) that shares the same set of case as ConvertBetweenCodepageAndWide. The test cases were expanded and revised a bit. BUG=2939,13229,4619 http://crbug.com/2939 http://crbug.com/13229 http://crbug.com/4619 TEST=1. Pass URLRequest*.FTP* (net_unittests) 2. Pass StringUtiltTest.ConvertBetweenCode* 3. Pass NetUtil*.GetDirectoryLis* (net_unittests) 4. Open a local directory containing files with non-ASCII names and they're displayed correctly in the directory list. On Windows and Mac OS X, it should always work. On Linux, your locale encoding (as returned by nl_langinfo(CODESET)) should match the actual encoding used in your filename. 5a. Pass NetUtil*.FileURL* (net_unittests) with the default codepage set to 1252 and 932. 5b. Make a file named 'caf챕.txt' on Windows and see if it can be opened both by clicking in the directory listing page of Chrome and by drag'n'drop. Test this with the default OS code pages set to Windows-1252, Windows-1251 (Russian) and Windows-932 (Japanese). Review URL: http://codereview.chromium.org/151065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20331 0039d316-1c4b-4281-b951-d872f2087c98
* Pass through non-character codepoints in UTF-8,16,32 and Wide conversion ↵jshin@chromium.org2009-06-241-7/+25
| | | | | | | | | | | | | | | | | | | | functions. They're structurally valid code points unlike malformed byte/surrogate sequences. I believe it's better to leave them alone in conversion functions. This CL was triggered by file_util_unittest failure on Linux/Mac with my upcoming change to file_util::ReplaceIllegalCharacters (a part of http://codereview.chromium.org/126223 ). In addition, the upper bound for the output length in CodepageToWide was tightened. TEST=pass string_util and file_util unittests BUG=NONE Review URL: http://codereview.chromium.org/147038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19132 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-101-1/+0
| | | | | | | | | Normalize end of file newlines in base/. All files end in a single newline. Review URL: http://codereview.chromium.org/42011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11329 0039d316-1c4b-4281-b951-d872f2087c98
* Make UTF8ToWide take a StringPiece, to avoid copying to a std::string.deanm@chromium.org2009-03-051-1/+1
| | | | | | | | | The previous prototype took only a std::string, unless you used the less convenient output parameter version. This required copying char* input to a std::string. Using a StringPiece the input will be implicitly both std::string and char* without any copying. This helps especially on Linux, where all input we get will be in utf8 char*. Review URL: http://codereview.chromium.org/40106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10985 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes Issue 7377: Regression: Omnibox trims URL ending with 0x85 (Take 2)hbono@chromium.org2009-03-051-0/+14
| | | | | | | | | This is the same change as "http://codereview.chromium.org/20219/show", which I reverted it because it caused build breaks on sandbox. To investigate this build break, it seems this build break is somehow caused by "base/string_util.cc" that includes the TrimWhiteSpaceUTF8() function. To fix this build break, I moved the TrimWhiteSpaceUTF8() function to "base/string_util_icu.cc". BUG=7377 Review URL: http://codereview.chromium.org/28310 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10970 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-1/+1
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Move std::string16 to base::string16. Don't pollute the std namespace. Don'tmmentovai@google.com2008-08-271-31/+27
| | | | | | assume that all string types can be represented as std::basic_string<CHAR>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1464 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Linux & Mac builds. I swapped the types of two templates.brettw@google.com2008-08-261-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1398 0039d316-1c4b-4281-b951-d872f2087c98
* Add UTF8 <-> UTF-16 conversion functions, and a WebCore::String -> ↵brettw@google.com2008-08-261-17/+101
| | | | | | std::string function. We already have a std::string -> WebCore::String function. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1393 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Fix some warnings found in string unittests.evanm@google.com2008-08-191-3/+8
| | | | | | | (Preparation for enabling -Wall -Werror.) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1012 0039d316-1c4b-4281-b951-d872f2087c98
* Unify maintenance of NumberFormat objects into a cross-platform Singleton. ↵mmentovai@google.com2008-08-131-5/+20
| | | | | | Clean up some dead code and dead files. WideToNativeMB and its inverse have been obsoleted by SysWideToNativeMB in sys_string_conversions*. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@806 0039d316-1c4b-4281-b951-d872f2087c98
* Fix string_util and its tests for the Mac, GCC, UTF-32 wchar_t platforms, ↵mmentovai@google.com2008-08-131-3/+3
| | | | | | and POSIX systems generally. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@771 0039d316-1c4b-4281-b951-d872f2087c98
* Back out r736 due to breakagemmentovai@google.com2008-08-121-3/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@738 0039d316-1c4b-4281-b951-d872f2087c98
* Fix string_util and its tests for the Mac, GCC, UTF-32 wchar_t platforms, ↵mmentovai@google.com2008-08-121-3/+3
| | | | | | and POSIX systems generally. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@736 0039d316-1c4b-4281-b951-d872f2087c98
* Complete brett's string conversion goodness for utf32 platforms.pinkerton@google.com2008-08-071-3/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@542 0039d316-1c4b-4281-b951-d872f2087c98
* Add UTF-16 <-> Wide conversions for Mac.brettw@google.com2008-08-071-10/+79
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@534 0039d316-1c4b-4281-b951-d872f2087c98
* Add defines for the size of wchar_t to build_config.h. Use this in places ↵brettw@google.com2008-08-071-26/+22
| | | | | | | | | | where we currently have an OS-specific check. Remove all WIN32 ifdefs from base and replace them with proper defined(OS...). I also fixed random style bits when I encountered them. I made major style fixes to string16. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@524 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the old NativeMB functions from string util, and use the new ones in ↵brettw@google.com2008-08-071-0/+190
| | | | | | sys_strings.h. I also removed duplicated code from the sandbox that can now use this, and fixed one case in the bug reporter that should not have been using the native multibyte encoding. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@515 0039d316-1c4b-4281-b951-d872f2087c98
* Revert my UTF change until we can figure out what to do with the sandbox.brettw@google.com2008-08-011-169/+0
| | | | | | BUG=1201008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215 0039d316-1c4b-4281-b951-d872f2087c98
* Write our own utf8<->wide conversion functions. This gives us more control ↵brettw@google.com2008-08-011-0/+169
| | | | | | over error handling instead of getting a blank string for invalid encodings. It also allows us to decrease the amount of platform-specific code. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+201
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98