Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Provide "toCharCode" to complement String.fromCharCode #958

Closed
DartBot opened this issue Dec 25, 2011 · 5 comments
Closed

Provide "toCharCode" to complement String.fromCharCode #958

DartBot opened this issue Dec 25, 2011 · 5 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Dec 25, 2011

This issue was originally filed by jeffbailey@google.com


The String class provides fromCharCode, but has no matching toCharCode. The lack of this is a JavaScriptism, but it's useful to provide this for handling control characters. GWT provides this by allowing casts from char to int and generates the JS with the appropriate integer.

@DartBot
Copy link
Author

DartBot commented Dec 25, 2011

This comment was originally written by jeffbailey@google.com

@DartBot
Copy link
Author

DartBot commented Dec 25, 2011

This comment was originally written by fraser...@google.com


How would this be different from the existing String.charCodeAt(int index)?

@dgrove
Copy link
Contributor

dgrove commented Jan 2, 2012

Added Area-Library, Triaged labels.

@andersjohnsen
Copy link

String now have a 'charCodes' getter. I'm not sure when it was introduced, but closing issue.


Added Fixed label.

@DartBot DartBot added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Jan 3, 2013
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
@stevenspiel
Copy link

stevenspiel commented Jul 23, 2019

I believe codeUnits is now the getter

String.fromCharCodes("foo".codeUnits) == "foo"

dart-bot pushed a commit that referenced this issue Nov 6, 2020
2020-11-05 irina.arkhipets@gmail.com Fixes #602: New tests for least and greatest closures added.
2020-11-05 sgrekhov@unipro.ru #926. Rewrite io/Process/start_A01_t02 test to work on precompiled environment
2020-11-05 sgrekhov@unipro.ru #932. Rewrite HttpRequestUpload/onLoad_A01_t01 test to send correct HttpRequest
2020-11-04 sgrekhov@unipro.ru Fixes #956. Don't expect extension invocation on type dynamic
2020-11-04 karlklose@users.noreply.github.com Convert some multi-tests to static error framework  (#958)
2020-11-03 irina.arkhipets@gmail.com Fixes #602: dynamic tests for least and greatest closures updated.
2020-11-03 irina.arkhipets@gmail.com Fixes #602: tests for least and greatest closures added.
2020-10-28 sgrekhov@unipro.ru #926. Fix two Process tests to use 'process_test' tool
2020-10-28 sgrekhov@unipro.ru #926. Rewrite two Process tests to use 'process_test' tool
2020-10-28 sgrekhov@unipro.ru Fixes #955. Expect less specific error for typed_data tests
2020-10-26 sgrekhov@unipro.ru Fixes #954. Change the line where we expect an error for CFE
2020-10-20 sgrekhov@unipro.ru Fixes #912. Abstract variables syntax tests added
2020-10-19 sgrekhov@unipro.ru #912. More external variables syntax tests added
2020-10-17 sgrekhov@unipro.ru External variables syntax test added
2020-10-16 sgrekhov@unipro.ru #912. More test for static analysis of external variables added
2020-10-15 sgrekhov@unipro.ru #912. Test for static analysis of external variables added
2020-10-14 sgrekhov@unipro.ru #912. Test for static analysis if abstract variables added

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,analyzer-nnbd-win-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,front-end-nnbd-win-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-win-release-x64-try
Change-Id: Id9cde784918faa4e891da8c4cb448d415a7a18aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170680
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
copybara-service bot pushed a commit that referenced this issue Jun 12, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/2a39574..5799424):
  57994242  2023-06-09  Parker Lougheed  Remove old <nodoc> syntax (#3261)

http (https://github.com/dart-lang/http/compare/5312366..ba7eb60):
  ba7eb60  2023-06-09  Brian Quinlan  Run common URLSessionTask tests on URLSessionWebSocketTask (#959)
  1746017  2023-06-09  Brian Quinlan  Support delegate methods for WebSocketTask (#958)

mockito (https://github.com/dart-lang/mockito/compare/cca4858..1d6064a):
  1d6064a  2023-06-09  Nate Bosch  Prepare to publish

webdev (https://github.com/dart-lang/webdev/compare/a6d761d..81ae77a):
  81ae77aa  2023-06-09  Elliott Brooks  Update Dart Debug Extension version in preparation for publishing (#2139)
  bb9265a0  2023-06-09  Elliott Brooks  Update DCM workflow (#2135)
  7652f646  2023-06-09  Elliott Brooks  Double the timeout for the webdev installation test (#2137)

Change-Id: I9d775bbb5c8a710a3339fa3434a95e8e0f2af75c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants