From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 9ACBB1F4CC for ; Fri, 10 Jan 2025 18:13:38 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=W68EOBtu; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=VcjCbdjE; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1736532785; bh=6/r4rKuIc1tkSic5VQhzoqx5N/hMA5he2C8wbeCKRJw=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=W68EOBtuouickizgwKUCnGXKvOy/JuZSL7JM/jaHxOyifxAIEMVY5uYIQdL1p+9XS kccpUl2My/SqFfzTMmRpYbQEQzFBGeY8BFzqJoDzpV8F0y6N4ZSJsTbEABXQK0w0dV V24gJZq+YDzudg5DFBUSUh+oFmx/CByU6YYcffdg= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id D0D75467E1 for ; Fri, 10 Jan 2025 18:13:05 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=VcjCbdjE; dkim-atps=neutral Received: from s.wfbtzhsw.outbound-mail.sendgrid.net (s.wfbtzhsw.outbound-mail.sendgrid.net [159.183.224.105]) by nue.mailmanlists.eu (Postfix) with ESMTPS id E4360467D2 for ; Fri, 10 Jan 2025 18:13:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=haS31Vad8FLHWqvr7Cf896asAb9ijbo3XZbZspo84ts=; b=VcjCbdjEJ4ftCyzRpbKAediMGxdFW5ztbm7q3OVbz+TxnDw0BMGDpPg1ZPs0RMCrCGC1 YyEaPc3i5+oZ4T7dcgo4rqlywgkbhPSxQpavDkFzHPnfyYiBTx45s+EbsqlsbLJQbbSqq6 RWt5YOrLO7GOiY7fxcv6QZ3vsA18OEWdUJlJ94QZat0nPPxzttt+uhyscWmMov73aCQGA+ RoU38Q+T0p6DQwa6fpPox6Y6U8Ldnb+gZH9OY0Msbta5nsuoywtrT3zJSf3ZcRoz8hVwhB /pERSYxRd/cAh3Ks0Hm+SypUNNn3a1+l5O/0vSU+GE8yoAFaocC8CWnizkLc1DIQ== Received: by recvd-5f9ffdf494-fbl9r with SMTP id recvd-5f9ffdf494-fbl9r-1-6781632C-6 2025-01-10 18:13:00.109635741 +0000 UTC m=+4913662.637718479 Received: from herokuapp.com (unknown) by geopod-ismtpd-5 (SG) with ESMTP id XOQq23bQQiu37gA0E2D_0A for ; Fri, 10 Jan 2025 18:13:00.057 +0000 (UTC) Date: Fri, 10 Jan 2025 18:13:00 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Misc X-Redmine-Issue-Id: 21025 X-Redmine-Issue-Author: deivid X-Redmine-Issue-Priority: Normal X-Redmine-Sender: deivid X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 97291 X-SG-EID: =?us-ascii?Q?u001=2EylzRTT3GG24XITUBroBe7Vu=2FcLwq5cTmVTMQhzlQkRs17HzFdvuwXQJs4?= =?us-ascii?Q?1gUmHQW7OnijYNkHuUORvf3qUg8TiacGeco+fTB?= =?us-ascii?Q?ZtiNI49V2QOhouuVb5PKj7DYxTQOsjyC=2FdFHKTT?= =?us-ascii?Q?W38hyT8GWT34HSyPlP2Gb5=2FTMMuKdaLHihaecHI?= =?us-ascii?Q?kVhmvzPldUV3ZvehRpOxVGhkpzsUqIb=2F6TamueK?= =?us-ascii?Q?6tPCYL8zD6eMH=2Flv=2FE4voF4OW6Y4NQbNY1LMEh=2F?= =?us-ascii?Q?6cDF?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: CFPVD75KUOZIHVS7JZQYHAUGAIKRFMAR X-Message-ID-Hash: CFPVD75KUOZIHVS7JZQYHAUGAIKRFMAR X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:120604] [Ruby master Misc#21025] What's the default encoding of `String.new`? List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: deivid via ruby-core Cc: deivid Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Issue #21025 has been updated by deivid (David Rodr=EDguez). Cool, thanks for the info, I'll create a PR to improve the documentation. ---------------------------------------- Misc #21025: What's the default encoding of `String.new`? https://bugs.ruby-lang.org/issues/21025#change-111432 * Author: deivid (David Rodr=EDguez) * Status: Open ---------------------------------------- In the documentation (https://docs.ruby-lang.org/en/3.4/encodings_rdoc.html= #label-String+Encoding) I see a good explanation of default string encoding= s: ![](Captura%20de%20pantalla%202025-01-10%20a%20las%2017.53.06.png) However, it does not mention `String.new` without an argument, which is the= one case where I see inconsistent behavior. ``` irb(main):001> "".encoding =3D> # irb(main):002> String.new("").encoding =3D> # irb(main):003> String.new(a=3D"").encoding =3D> # irb(main):004> String.new.encoding =3D> # ``` Should this be documented or changed? ---Files-------------------------------- Captura de pantalla 2025-01-10 a las 17.53.06.png (139 KB) --=20 https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.rub= y-lang.org/