php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81695 substring issue
Submitted: 2021-12-03 16:00 UTC Modified: 2021-12-03 16:29 UTC
From: felipeg at hemodynamics dot cl Assigned: cmb (profile)
Status: Not a bug Package: *Unicode Issues
PHP Version: 7.3.33 OS: linux, macos
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: felipeg at hemodynamics dot cl
New email:
PHP Version: OS:

 

 [2021-12-03 16:00 UTC] felipeg at hemodynamics dot cl
Description:
------------
---
From manual page: https://php.net/function.substr
---
I tested this problem on linux server, macOs and debian 9.9.
it looks like when substr evaluate "ñó", php translate as ?> and shows no output.

Test script:
---------------
echo substr("Diagnóstico: Infección del muñón, infracondilea izquierda\n", 0, 34);
echo substr("Diagnóstico: Infección del muñón, infracondilea izquierda\n", 0, 34);

Expected result:
----------------
Diagnóstico: Infección del muñ?Diagnóstico: Infección del muñ?Diagnóstico: Infección del muñ?Diagnóstico: Infección del muñ?

Actual result:
--------------
Diagnóstico: Infección del muñ?Diagnóstico: Infección del muñ?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-12-03 16:29 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-12-03 16:29 UTC] cmb@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

See <https://3v4l.org/FFte1> and <https://3v4l.org/Zv0oj>, and read
up on character encodings.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC