Convert encoding type to UTF-8 for CSV import (#7689)

* Convert encoding type to UTF-8 for CSV import

* Update bridge_imports.php

* Update destination_imports.php

* Update device_imports.php

* Update destination_imports.php

* Update bridge_imports.php

* Update access_control_import.php

* Update extension_imports.php

* Update voicemail_imports.php

* Update contact_import.php

* Update user_imports.php
This commit is contained in:
Alex
2026-01-08 10:05:05 -07:00
committed by GitHub
parent e65cfe5ce1
commit dd40d23d71
8 changed files with 35 additions and 11 deletions

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024
Portions created by the Initial Developer are Copyright (C) 2008-2026
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -265,6 +265,9 @@
//loop through the array
while (($line = fgets($handle, 4096)) !== false) {
//convert the line to UTF-8
$line = mb_convert_encoding($line, 'UTF-8');
if ($from_row <= $row_number) {
//format the data
$y = 0;

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2019-2024
Portions created by the Initial Developer are Copyright (C) 2019-2026
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -238,7 +238,7 @@
//user selected fields
$fields = $_POST['fields'];
//set the domain_uuid
$domain_uuid = $_SESSION['domain_uuid'];
@@ -251,13 +251,16 @@
//loop through the array
while (($line = fgets($handle, 4096)) !== false) {
//convert the line to UTF-8
$line = mb_convert_encoding($line, 'UTF-8');
if ($from_row <= $row_number) {
//format the data
$y = 0;
foreach ($fields as $key => $value) {
//get the line
$result = str_getcsv($line, $delimiter, $enclosure);
//get the table and field name
$field_array = explode(".",$value);
$table_name = $field_array[0];
@@ -265,7 +268,7 @@
//echo "value: $value<br />\n";
//echo "table_name: $table_name<br />\n";
//echo "field_name: $field_name<br />\n";
//get the parent table name
$parent = get_parent($schema, $table_name);

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2018-2025
Portions created by the Initial Developer are Copyright (C) 2018-2026
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -167,6 +167,9 @@
//loop through the array
while (($line = fgets($handle, 4096)) !== false) {
//convert the line to UTF-8
$line = mb_convert_encoding($line, 'UTF-8');
if ($from_row <= $row_number) {
//format the data
$y = 0;

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2018-2024
Portions created by the Initial Developer are Copyright (C) 2018-2026
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -261,6 +261,9 @@
//loop through the array
while (($line = fgets($handle, 4096)) !== false) {
//convert the line to UTF-8
$line = mb_convert_encoding($line, 'UTF-8');
if ($from_row <= $row_number) {
//format the data
$y = 0;

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2018-2020
Portions created by the Initial Developer are Copyright (C) 2018-2026
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -260,6 +260,9 @@
//loop through the array
while (($line = fgets($handle, 4096)) !== false) {
//convert the line to UTF-8
$line = mb_convert_encoding($line, 'UTF-8');
if ($from_row <= $row_number) {
//format the data
$y = 0;

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2019-2024
Portions created by the Initial Developer are Copyright (C) 2019-2026
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -257,6 +257,9 @@
//loop through the array
while (($line = fgets($handle, 4096)) !== false) {
//convert the line to UTF-8
$line = mb_convert_encoding($line, 'UTF-8');
if ($from_row <= $row_number) {
//format the data
$y = 0;

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024
Portions created by the Initial Developer are Copyright (C) 2008-2026
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -294,6 +294,9 @@
//loop through the array
while (($line = fgets($handle, 4096)) !== false) {
//convert the line to UTF-8
$line = mb_convert_encoding($line, 'UTF-8');
if ($from_row <= $row_number) {
//format the data
$y = 0;

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2023
Portions created by the Initial Developer are Copyright (C) 2008-2026
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -260,6 +260,9 @@
//loop through the array
while (($line = fgets($handle, 4096)) !== false) {
//convert the line to UTF-8
$line = mb_convert_encoding($line, 'UTF-8');
if ($from_row <= $row_number) {
//get the user_uuid
$user_uuid = uuid();